Skip to content

Commit 5f388d0

Browse files
committed
[clang] add -fimplicit-constexpr flag (for new constexpr interpret)
1 parent 0062163 commit 5f388d0

6 files changed

+159
-44
lines changed

clang/lib/AST/ByteCode/ByteCodeEmitter.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ void ByteCodeEmitter::compileFunc(const FunctionDecl *FuncDecl,
7070
Func->setDefined(true);
7171

7272
// Lambda static invokers are a special case that we emit custom code for.
73-
bool IsEligibleForCompilation = Func->isLambdaStaticInvoker() ||
74-
FuncDecl->isConstexpr() ||
75-
FuncDecl->hasAttr<MSConstexprAttr>();
73+
bool IsEligibleForCompilation =
74+
Func->isLambdaStaticInvoker() ||
75+
FuncDecl->isConstexprOrImplicitlyCanBe(Ctx.getLangOpts()) ||
76+
FuncDecl->hasAttr<MSConstexprAttr>();
7677

7778
// Compile the function body.
7879
if (!IsEligibleForCompilation || !visitFunc(FuncDecl)) {

clang/lib/AST/ByteCode/Interp.cpp

+17-7
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,8 @@ bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {
827827
return false;
828828

829829
if (F->isConstexpr() && F->hasBody() &&
830-
(F->getDecl()->isConstexpr() || F->getDecl()->hasAttr<MSConstexprAttr>()))
830+
(F->getDecl()->isConstexprOrImplicitlyCanBe(S.getLangOpts()) ||
831+
F->getDecl()->hasAttr<MSConstexprAttr>()))
831832
return true;
832833

833834
// Implicitly constexpr.
@@ -846,7 +847,7 @@ bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {
846847
const auto *CD = dyn_cast<CXXConstructorDecl>(DiagDecl);
847848
if (CD && CD->isInheritingConstructor()) {
848849
const auto *Inherited = CD->getInheritedConstructor().getConstructor();
849-
if (!Inherited->isConstexpr())
850+
if (!Inherited->isConstexprOrImplicitlyCanBe(S.getLangOpts()))
850851
DiagDecl = CD = Inherited;
851852
}
852853

@@ -868,19 +869,28 @@ bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {
868869
// for a constant expression. It might be defined at the point we're
869870
// actually calling it.
870871
bool IsExtern = DiagDecl->getStorageClass() == SC_Extern;
871-
if (!DiagDecl->isDefined() && !IsExtern && DiagDecl->isConstexpr() &&
872+
if (!DiagDecl->isDefined() && !IsExtern &&
873+
DiagDecl->isConstexprOrImplicitlyCanBe(S.getLangOpts()) &&
872874
S.checkingPotentialConstantExpression())
873875
return false;
874876

875877
// If the declaration is defined, declared 'constexpr' _and_ has a body,
876878
// the below diagnostic doesn't add anything useful.
877-
if (DiagDecl->isDefined() && DiagDecl->isConstexpr() &&
879+
if (DiagDecl->isDefined() &&
880+
DiagDecl->isConstexprOrImplicitlyCanBe(S.getLangOpts()) &&
878881
DiagDecl->hasBody())
879882
return false;
880883

881-
S.FFDiag(S.Current->getLocation(OpPC),
882-
diag::note_constexpr_invalid_function, 1)
883-
<< DiagDecl->isConstexpr() << (bool)CD << DiagDecl;
884+
if (F->getDecl()->isConstexprOrImplicitlyCanBe(S.getLangOpts(), false)) {
885+
S.FFDiag(S.Current->getLocation(OpPC),
886+
diag::note_constexpr_implicit_constexpr_must_be_inlined, 1)
887+
<< DiagDecl;
888+
} else {
889+
S.FFDiag(S.Current->getLocation(OpPC),
890+
diag::note_constexpr_invalid_function, 1)
891+
<< DiagDecl->isConstexprOrImplicitlyCanBe(S.getLangOpts())
892+
<< (bool)CD << DiagDecl;
893+
}
884894

885895
if (DiagDecl->getDefinition())
886896
S.Note(DiagDecl->getDefinition()->getLocation(),

clang/test/Sema/implicit-constexpr-basic.cpp

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
// RUN: %clang_cc1 -verify=ALL_NORMAL,NORMAL14,BOTH14,ALL_PRE20,ALLNORMAL,NORMAL_PRE20,ALL -std=c++14 %s -fcolor-diagnostics
2-
// RUN: %clang_cc1 -verify=IMPLICIT14,IMPLICIT_PRE20,BOTH14,ALL_PRE20,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++14 %s -fcolor-diagnostics
31

4-
// RUN: %clang_cc1 -verify=ALL_NORMAL,NORMAL17,BOTH17,ALL_PRE20,ALLNORMAL,NORMAL_PRE20,ALL -std=c++17 %s -fcolor-diagnostics
5-
// RUN: %clang_cc1 -verify=IMPLICIT17,IMPLICIT_PRE20,BOTH17,ALL_PRE20,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++17 %s -fcolor-diagnostics
2+
// RUN: %clang_cc1 -verify=ALL_NORMAL,NORMAL14,BOTH14,ALL_PRE20,ALLNORMAL,NORMAL_PRE20,ALL -std=c++14 %s
3+
// RUN: %clang_cc1 -verify=IMPLICIT14,IMPLICIT_PRE20,BOTH14,ALL_PRE20,ALLIMPLICIT,ALLIMPLICITOLD,ALL -fimplicit-constexpr -std=c++14 %s
4+
// RUN: %clang_cc1 -verify=IMPLICIT14,IMPLICIT_PRE20,BOTH14,ALL_PRE20,ALLIMPLICIT,ALLIMPLICITNEW,ALL -fimplicit-constexpr -std=c++14 %s -fexperimental-new-constant-interpreter
65

7-
// RUN: %clang_cc1 -verify=ALL_NORMAL,NORMAL20,BOTH20,ALLNORMAL,ALL -std=c++20 %s -fcolor-diagnostics
8-
// RUN: %clang_cc1 -verify=IMPLICIT20,BOTH20,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++20 %s -fcolor-diagnostics
6+
// RUN: %clang_cc1 -verify=ALL_NORMAL,NORMAL17,BOTH17,ALL_PRE20,ALLNORMAL,NORMAL_PRE20,ALL -std=c++17 %s
7+
// RUN: %clang_cc1 -verify=IMPLICIT17,IMPLICIT_PRE20,BOTH17,ALL_PRE20,ALLIMPLICIT,ALLIMPLICITOLD,ALL -fimplicit-constexpr -std=c++17 %s
8+
// RUN: %clang_cc1 -verify=IMPLICIT17,IMPLICIT_PRE20,BOTH17,ALL_PRE20,ALLIMPLICIT,ALLIMPLICITNEW,ALL -fimplicit-constexpr -std=c++17 %s -fexperimental-new-constant-interpreter
99

10-
// RUN: %clang_cc1 -verify=ALL_NORMAL,NORMAL23,BOTH23,ALLNORMAL,ALL -std=c++23 %s -fcolor-diagnostics
11-
// RUN: %clang_cc1 -verify=IMPLICIT23,BOTH23,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++23 %s -fcolor-diagnostics
10+
// RUN: %clang_cc1 -verify=ALL_NORMAL,NORMAL20,BOTH20,ALLNORMAL,ALL -std=c++20 %s
11+
// RUN: %clang_cc1 -verify=IMPLICIT20,BOTH20,ALLIMPLICIT,ALLIMPLICITOLD,ALL -fimplicit-constexpr -std=c++20 %s
12+
// RUN: %clang_cc1 -verify=IMPLICIT20,BOTH20,ALLIMPLICIT,ALLIMPLICITNEW,ALL -fimplicit-constexpr -std=c++20 %s -fexperimental-new-constant-interpreter
13+
14+
// RUN: %clang_cc1 -verify=ALL_NORMAL,NORMAL23,BOTH23,ALLNORMAL,ALL -std=c++23 %s
15+
// RUN: %clang_cc1 -verify=IMPLICIT23,BOTH23,ALLIMPLICIT,ALLIMPLICITOLD,ALL -fimplicit-constexpr -std=c++23 %s
16+
// RUN: %clang_cc1 -verify=IMPLICIT23,BOTH23,ALLIMPLICIT,ALLIMPLICITNEW,ALL -fimplicit-constexpr -std=c++23 %s -fexperimental-new-constant-interpreter
1217

1318

1419

@@ -49,8 +54,8 @@ bool noinline_undefined_fnc();
4954
constexpr bool result_noinline_undefined_fnc = noinline_undefined_fnc();
5055
// ALL-error@-1 {{constexpr variable 'result_noinline_undefined_fnc' must be initialized by a constant expression}}
5156
// ALLNORMAL-note@-2 {{non-constexpr function 'noinline_undefined_fnc' cannot be used in a constant expression}}
52-
// ALLIMPLICIT-note@-3 {{undefined function 'noinline_undefined_fnc' cannot be used in a constant expression}}
53-
57+
// ALLIMPLICITOLD-note@-3 {{undefined function 'noinline_undefined_fnc' cannot be used in a constant expression}}
58+
// ALLIMPLICITNEW-note@-4 {{non-inline function 'noinline_undefined_fnc' is not implicitly constexpr}}
5459

5560
// =============================================
5661
// 4) undefined inline function
@@ -61,7 +66,8 @@ inline bool inline_undefined_fnc();
6166
constexpr bool result_inline_undefined_fnc = inline_undefined_fnc();
6267
// ALL-error@-1 {{constexpr variable 'result_inline_undefined_fnc' must be initialized by a constant expression}}
6368
// ALLNORMAL-note@-2 {{non-constexpr function 'inline_undefined_fnc' cannot be used in a constant expression}}
64-
// ALLIMPLICIT-note@-3 {{undefined function 'inline_undefined_fnc' cannot be used in a constant expression}}
69+
// ALLIMPLICITOLD-note@-3 {{undefined function 'inline_undefined_fnc' cannot be used in a constant expression}}
70+
// ALLIMPLICITNEW-note@-4 {{non-inline function 'inline_undefined_fnc' is not implicitly constexpr}}
6571

6672
// =============================================
6773
// 5) lambda function
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// RUN: %clang_cc1 -verify=BEFORE -std=c++23 %s
2+
// RUN: %clang_cc1 -verify=AFTER -std=c++23 %s -fimplicit-constexpr
3+
4+
// AFTER-no-diagnostics
5+
6+
// FOLLOWING TWO EXAMPLES ESTABLISH THE `-fimplicit-constexpr` allows enter to constant evaluation for functions
7+
// which would be disabled based on:
8+
// [expr.const]#10.3 "an invocation of a non-constexpr function" (is not allowed)
9+
10+
// -------------------
11+
12+
inline int normal_function() {
13+
// BEFORE-note@-1 {{declared here}}
14+
return 42;
15+
}
16+
17+
constinit auto cinit = normal_function();
18+
// BEFORE-error@-1 {{variable does not have a constant initializer}}
19+
// BEFORE-note@-2 {{required by 'constinit' specifier here}}
20+
// BEFORE-note@-3 {{non-constexpr function 'normal_function' cannot be used in a constant expression}}
21+
22+
// -------------------
23+
24+
inline int still_normal_function() {
25+
// BEFORE-note@-1 {{declared here}}
26+
return 42;
27+
}
28+
29+
constexpr auto cxpr = still_normal_function();
30+
// BEFORE-error@-1 {{constexpr variable 'cxpr' must be initialized by a constant expression}}
31+
// BEFORE-note@-2 {{non-constexpr function 'still_normal_function' cannot be used in a constant expression}}
32+
33+
// -------------------
34+
35+
// Following example shows calling non-constexpr marked function in
36+
// constant evaluated context is no longer an error.
37+
38+
struct type_with_nonconstexpr_static_function {
39+
static /* non-constexpr */ int square(int v) {
40+
// BEFORE-note@-1 {{declared here}}
41+
return v*v;
42+
}
43+
44+
int value;
45+
constexpr type_with_nonconstexpr_static_function(int x): value{square(x)} { }
46+
// BEFORE-note@-1 {{non-constexpr function 'square' cannot be used in a constant expression}}
47+
// ^ (Hana's note: during evaluation)
48+
};
49+
50+
constexpr auto force_ce = type_with_nonconstexpr_static_function{4};
51+
// BEFORE-error@-1 {{constexpr variable 'force_ce' must be initialized by a constant expression}}
52+
// BEFORE-note@-2 {{in call to 'type_with_nonconstexpr_static_function(4)'}}
53+
54+
55+
// this is fine: as it's in runtime, where the constructor
56+
// is called in runtime, like a normal function, so it doesn't matter `square` is not constexpr
57+
static auto static_var = type_with_nonconstexpr_static_function{4};
58+
59+
60+
61+
// -------------------
62+
63+
// Following example shows now you can call non-constexpr marked even
64+
// from consteval function initiated constant evaluation.
65+
66+
inline int runtime_only_function() {
67+
// BEFORE-note@-1 {{declared here}}
68+
return 11;
69+
}
70+
71+
constexpr int constexpr_function() {
72+
return runtime_only_function();
73+
// BEFORE-note@-1 {{non-constexpr function 'runtime_only_function' cannot be used in a constant expression}}
74+
}
75+
76+
consteval int consteval_function() {
77+
return constexpr_function();
78+
// BEFORE-note@-1 {{in call to 'constexpr_function()'}}
79+
}
80+
81+
static int noncalled_runtime_function() {
82+
// we enter consteval context here to replace `consteval_function()` with a constant.
83+
// this is happen during parsing!!
84+
return consteval_function();
85+
// BEFORE-error@-1 {{call to consteval function 'consteval_function' is not a constant expression}}
86+
// BEFORE-note@-2 {{in call to 'consteval_function()'}}
87+
}
88+

clang/test/Sema/implicit-constexpr-features.cpp

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
// RUN: %clang_cc1 -verify=NORMAL14,NORMAL_ALL -std=c++14 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=
2-
// RUN: %clang_cc1 -verify=NORMAL17,NORMAL_ALL -std=c++17 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=
3-
// RUN: %clang_cc1 -verify=NORMAL20,NORMAL_ALL -std=c++20 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=
4-
// RUN: %clang_cc1 -verify=NORMAL23,NORMAL_ALL -std=c++23 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=
5-
// RUN: %clang_cc1 -verify=NORMAL26,NORMAL_ALL -std=c++26 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=
1+
// RUN: %clang_cc1 -verify=NORMAL14,NORMAL_ALL -std=c++14 %s -fcxx-exceptions -DCONSTEXPR=
2+
// RUN: %clang_cc1 -verify=NORMAL17,NORMAL_ALL -std=c++17 %s -fcxx-exceptions -DCONSTEXPR=
3+
// RUN: %clang_cc1 -verify=NORMAL20,NORMAL_ALL -std=c++20 %s -fcxx-exceptions -DCONSTEXPR=
4+
// RUN: %clang_cc1 -verify=NORMAL23,NORMAL_ALL -std=c++23 %s -fcxx-exceptions -DCONSTEXPR=
5+
// RUN: %clang_cc1 -verify=NORMAL26,NORMAL_ALL -std=c++26 %s -fcxx-exceptions -DCONSTEXPR=
66

7-
// RUN: %clang_cc1 -verify=IMPLICIT14,IMPLICIT_ALL -std=c++14 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
8-
// RUN: %clang_cc1 -verify=IMPLICIT17,IMPLICIT_ALL -std=c++17 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
9-
// RUN: %clang_cc1 -verify=IMPLICIT20,IMPLICIT_ALL -std=c++20 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
10-
// RUN: %clang_cc1 -verify=IMPLICIT23,IMPLICIT_ALL -std=c++23 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
11-
// RUN: %clang_cc1 -verify=IMPLICIT26,IMPLICIT_ALL -std=c++26 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
7+
// RUN: %clang_cc1 -verify=IMPLICIT14,IMPLICIT_ALL -std=c++14 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
8+
// RUN: %clang_cc1 -verify=IMPLICIT17,IMPLICIT_ALL -std=c++17 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
9+
// RUN: %clang_cc1 -verify=IMPLICIT20,IMPLICIT_ALL -std=c++20 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
10+
// RUN: %clang_cc1 -verify=IMPLICIT23,IMPLICIT_ALL -std=c++23 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
11+
// RUN: %clang_cc1 -verify=IMPLICIT26,IMPLICIT_ALL -std=c++26 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr
1212

13-
// RUN: %clang_cc1 -verify=CONSTEXPR14,CONSTEXPR_BEFORE23,CONSTEXPR_BEFORE20,CONSTEXPR_ALL -std=c++14 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=constexpr
14-
// RUN: %clang_cc1 -verify=CONSTEXPR17,CONSTEXPR_BEFORE23,CONSTEXPR_BEFORE20,CONSTEXPR_ALL -std=c++17 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=constexpr
15-
// RUN: %clang_cc1 -verify=CONSTEXPR20,CONSTEXPR_BEFORE23,CONSTEXPR_ALL -std=c++20 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=constexpr
16-
// RUN: %clang_cc1 -verify=CONSTEXPR23,CONSTEXPR_ALL -std=c++23 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=constexpr
17-
// RUN: %clang_cc1 -verify=CONSTEXPR26,CONSTEXPR_ALL -std=c++26 %s -fcolor-diagnostics -fcxx-exceptions -DCONSTEXPR=constexpr
13+
// RUN: %clang_cc1 -verify=IMPLICIT14,IMPLICIT_ALL -std=c++14 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr -fexperimental-new-constant-interpreter
14+
// RUN: %clang_cc1 -verify=IMPLICIT17,IMPLICIT_ALL -std=c++17 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr -fexperimental-new-constant-interpreter
15+
// RUN: %clang_cc1 -verify=IMPLICIT20,IMPLICIT_ALL -std=c++20 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr -fexperimental-new-constant-interpreter
16+
// RUN: %clang_cc1 -verify=IMPLICIT23,IMPLICIT_ALL -std=c++23 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr -fexperimental-new-constant-interpreter
17+
// RUN: %clang_cc1 -verify=IMPLICIT26,IMPLICIT_ALL -std=c++26 %s -fcxx-exceptions -DCONSTEXPR= -fimplicit-constexpr -fexperimental-new-constant-interpreter
18+
19+
// RUN: %clang_cc1 -verify=CONSTEXPR14,CONSTEXPR_BEFORE23,CONSTEXPR_BEFORE20,CONSTEXPR_ALL -std=c++14 %s -fcxx-exceptions -DCONSTEXPR=constexpr
20+
// RUN: %clang_cc1 -verify=CONSTEXPR17,CONSTEXPR_BEFORE23,CONSTEXPR_BEFORE20,CONSTEXPR_ALL -std=c++17 %s -fcxx-exceptions -DCONSTEXPR=constexpr
21+
// RUN: %clang_cc1 -verify=CONSTEXPR20,CONSTEXPR_BEFORE23,CONSTEXPR_ALL -std=c++20 %s -fcxx-exceptions -DCONSTEXPR=constexpr
22+
// RUN: %clang_cc1 -verify=CONSTEXPR23,CONSTEXPR_ALL -std=c++23 %s -fcxx-exceptions -DCONSTEXPR=constexpr
23+
// RUN: %clang_cc1 -verify=CONSTEXPR26,CONSTEXPR_ALL -std=c++26 %s -fcxx-exceptions -DCONSTEXPR=constexpr
1824

1925
// Objective is to make sure features like allocation / throwing won't fail code by just adding implicit constexpr
2026
// in an unevaluated code.

clang/test/Sema/implicit-constexpr-members.cpp

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
// RUN: %clang_cc1 -verify=NORMAL14,BOTH14,ALLNORMAL,ALL -std=c++14 %s -fcolor-diagnostics
2-
// RUN: %clang_cc1 -verify=IMPLICIT14,BOTH14,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++14 %s -fcolor-diagnostics
1+
// RUN: %clang_cc1 -verify=NORMAL14,BOTH14,ALLNORMAL,ALL -std=c++14 %s
2+
// RUN: %clang_cc1 -verify=IMPLICIT14,BOTH14,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++14 %s
3+
// RUN: %clang_cc1 -verify=IMPLICIT14,BOTH14,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++14 %s -fexperimental-new-constant-interpreter
34

4-
// RUN: %clang_cc1 -verify=NORMAL17,BOTH20,ALLNORMAL,ALL -std=c++17 %s -fcolor-diagnostics
5-
// RUN: %clang_cc1 -verify=IMPLICIT17,BOTH20,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++17 %s -fcolor-diagnostics
5+
// RUN: %clang_cc1 -verify=NORMAL17,BOTH20,ALLNORMAL,ALL -std=c++17 %s
6+
// RUN: %clang_cc1 -verify=IMPLICIT17,BOTH20,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++17 %s
7+
// RUN: %clang_cc1 -verify=IMPLICIT17,BOTH20,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++17 %s -fexperimental-new-constant-interpreter
68

7-
// RUN: %clang_cc1 -verify=NORMAL20,BOTH20,ALLNORMAL,ALL -std=c++20 %s -fcolor-diagnostics
8-
// RUN: %clang_cc1 -verify=IMPLICIT20,BOTH20,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++20 %s -fcolor-diagnostics
9+
// RUN: %clang_cc1 -verify=NORMAL20,BOTH20,ALLNORMAL,ALL -std=c++20 %s
10+
// RUN: %clang_cc1 -verify=IMPLICIT20,BOTH20,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++20 %s
11+
// RUN: %clang_cc1 -verify=IMPLICIT20,BOTH20,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++20 %s -fexperimental-new-constant-interpreter
912

10-
// RUN: %clang_cc1 -verify=NORMAL23,BOTH23,ALLNORMAL,ALL -std=c++23 %s -fcolor-diagnostics
11-
// RUN: %clang_cc1 -verify=IMPLICIT23,BOTH23,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++23 %s -fcolor-diagnostics
13+
// RUN: %clang_cc1 -verify=NORMAL23,BOTH23,ALLNORMAL,ALL -std=c++23 %s
14+
// RUN: %clang_cc1 -verify=IMPLICIT23,BOTH23,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++23 %s
15+
// RUN: %clang_cc1 -verify=IMPLICIT23,BOTH23,ALLIMPLICIT,ALL -fimplicit-constexpr -std=c++23 %s -fexperimental-new-constant-interpreter
1216

1317
// ALLIMPLICIT-no-diagnostics
1418

0 commit comments

Comments
 (0)