[clang] LambdaExpr::hasExplicitParameters() returns true for lambdas with a trailing return type (original) (raw)
(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:
and an implicit parameter list like:
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.