Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when a lambda contains a constrained parameter pack. #49

Closed
wants to merge 1 commit into from
Closed

Fix crash when a lambda contains a constrained parameter pack. #49

wants to merge 1 commit into from

Conversation

DanielBelow
Copy link

@DanielBelow DanielBelow commented Jan 9, 2020

  1. This fixes a crash in code like

    auto l = [](C auto ...cs) { };
    

    see https://godbolt.org/z/B8JCTL

  2. Adds the correct concept's location in the lambda parameter list to diagnostics.

    int main() {
      auto fun = [](Foo auto f) {};
      fun('a');
      return 0;
    }
    

    with diagnostic output

    <source>:5:14: note: candidate template ignored: constraints not satisfied [with f:auto = char]
    auto fun = [](Foo auto f) {};
         ^
    note: because 'char' does not satisfy 'Foo'
    

    (last line misses a SourceLocation) see https://godbolt.org/z/fPjTaE
    With the fix it correctly points to the beginning of Foo auto f

  3. Fixes Terse syntax does not work with lambdas #48

Fix crash when a lambda contains a constrained parameter pack.
Correctly initializes SourceLocations inside of AutoTypeLoc.
Correctly initializes passed template arguments in AutoTypeLoc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terse syntax does not work with lambdas
1 participant