File tree 1 file changed +18
-4
lines changed 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ consteval int f1(int i) {
8
8
return i;
9
9
}
10
10
11
- consteval constexpr int f2 (int i) {
11
+ consteval constexpr int f2 (int i) {
12
12
// expected-error@-1 {{cannot combine}}
13
13
return i;
14
14
}
@@ -195,7 +195,7 @@ auto ptr = ret1(0);
195
195
struct A {
196
196
consteval int f (int ) {
197
197
// expected-note@-1+ {{declared here}}
198
- return 0 ;
198
+ return 0 ;
199
199
}
200
200
};
201
201
@@ -239,7 +239,7 @@ constexpr int f_c(int i) {
239
239
int t = f (i);
240
240
// expected-error@-1 {{is not a constant expression}}
241
241
// expected-note@-2 {{function parameter}}
242
- return f (0 );
242
+ return f (0 );
243
243
}
244
244
245
245
consteval int f_eval (int i) {
@@ -675,7 +675,7 @@ Bar<derp> a; // expected-note {{in instantiation of member function 'issue_55601
675
675
676
676
struct constantDerp {
677
677
// Can be used in a constant expression.
678
- consteval constantDerp (int ) {}
678
+ consteval constantDerp (int ) {}
679
679
consteval operator int () const { return 5 ; }
680
680
};
681
681
Bar<constantDerp> b;
@@ -1162,3 +1162,17 @@ struct C {
1162
1162
};
1163
1163
1164
1164
}
1165
+
1166
+ namespace GH66562 {
1167
+
1168
+ namespace ns
1169
+ {
1170
+ consteval int foo (int x) { return 1 ; } // expected-note {{declared here}}
1171
+ }
1172
+
1173
+ template <class A >
1174
+ struct T {
1175
+ static constexpr auto xx = ns::foo(A{}); // expected-error {{cannot take address of consteval function 'foo' outside of an immediate invocation}}
1176
+ };
1177
+
1178
+ }
You can’t perform that action at this time.
0 commit comments