-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Copy link
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"lambdaC++11 lambda expressionsC++11 lambda expressions
Description
The following should be well-formed, but clang diagnoses:
void runtime_only() { }
consteval void comptime_only() {}
void fn() {
[]() {
runtime_only();
[](){ (void) comptime_only; }();
}();
}The id-expression that names comptime_only is immediate-escalating. Clang currently attributes that expression to the outer lambda, despite its occurrence within the inner lambda. It seems to me that this stems from the ExpressionEvaluationContext corresponding to the inner lambda being popped after the FunctionScopeInfo corresponding to the same has already been popped. Naively re-sequencing these operations appears to cause other problems (e.g., failing assertions related to ODR-uses in ActOnFinishFunctionBody).
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"lambdaC++11 lambda expressionsC++11 lambda expressions