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(
1777717777 Current.InImmediateEscalatingFunctionContext =
1777817778 getLangOpts().CPlusPlus20 && FD->isImmediateEscalating();
1777917779
17780- if (isLambdaMethod(FD)) {
17781- Current.InDiscardedStatement = Parent.isDiscardedStatementContext();
17780+ if (isLambdaMethod(FD))
1778217781 Current.InImmediateFunctionContext =
1778317782 FD->isConsteval() ||
1778417783 (isLambdaMethod(FD) && (Parent.isConstantEvaluated() ||
1778517784 Parent.isImmediateFunctionContext()));
17786- } else {
17785+ else
1778717786 Current.InImmediateFunctionContext = FD->isConsteval();
17788- }
1778917787 }
1779017788}
1779117789
Original file line number Diff line number Diff line change @@ -208,6 +208,14 @@ void test() {
208208
209209 }
210210}
211+
212+ void regression () {
213+ if constexpr (false ) {
214+ auto lam = []() { return 0 ; };
215+ 1 | lam (); // expected-warning {{unused}}
216+ }
217+ }
218+
211219}
212220
213221#endif
You can’t perform that action at this time.
0 commit comments