-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
clang:as-a-librarylibclang and C++ APIlibclang and C++ APIclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributelambdaC++11 lambda expressionsC++11 lambda expressions
Description
(LLVM version 20.1.8)
For context, I am writing a clang-tidy pass for a codebase which deals with lambda coroutines, and need to disambiguate between a lambda with an empty parameter list like:
auto l = [](){};and an implicit parameter list like:
auto l = []{};hasExplicitParameters() correctly returns false, true in the above cases, but when adding a trailing return type (which is needed to properly define a lambda coroutine), hasExplicitParameters() no longer returns what you would expect, e.g.
auto l = []() -> int { return 0; };auto l = [] -> int { return 0; };Here, hasExplicitParameters() returns true, true.
Metadata
Metadata
Assignees
Labels
clang:as-a-librarylibclang and C++ APIlibclang and C++ APIclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributelambdaC++11 lambda expressionsC++11 lambda expressions