Skip to content

ICE when returning the captured reference in the deducing this lambda #79754

Closed
@hewillk

Description

@hewillk
int main() {
  int x = 42;
  auto l = [&x](this auto&& self, int n) {
    return x;
  };
  l(10);
}

https://godbolt.org/z/bdvKn9M6T

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]lambdaC++11 lambda expressions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions