File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
test/CXX/stmt.stmt/stmt.select/stmt.if Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -17777,15 +17777,13 @@ void Sema::PushExpressionEvaluationContextForFunction(
17777
17777
Current.InImmediateEscalatingFunctionContext =
17778
17778
getLangOpts().CPlusPlus20 && FD->isImmediateEscalating();
17779
17779
17780
- if (isLambdaMethod(FD)) {
17781
- Current.InDiscardedStatement = Parent.isDiscardedStatementContext();
17780
+ if (isLambdaMethod(FD))
17782
17781
Current.InImmediateFunctionContext =
17783
17782
FD->isConsteval() ||
17784
17783
(isLambdaMethod(FD) && (Parent.isConstantEvaluated() ||
17785
17784
Parent.isImmediateFunctionContext()));
17786
- } else {
17785
+ else
17787
17786
Current.InImmediateFunctionContext = FD->isConsteval();
17788
- }
17789
17787
}
17790
17788
}
17791
17789
Original file line number Diff line number Diff line change @@ -208,6 +208,14 @@ void test() {
208
208
209
209
}
210
210
}
211
+
212
+ void regression () {
213
+ if constexpr (false ) {
214
+ auto lam = []() { return 0 ; };
215
+ 1 | lam (); // expected-warning {{unused}}
216
+ }
217
+ }
218
+
211
219
}
212
220
213
221
#endif
You can’t perform that action at this time.
0 commit comments