File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1332,6 +1332,14 @@ constexpr bool foo(int *i) {
1332
1332
static_assert (foo(nullptr ), " " ); // expected-note {{in call to 'foo(nullptr)'}}
1333
1333
// expected-error@-1 {{static assertion expression is not an integral constant expression}}
1334
1334
1335
+ constexpr bool foo_rvalue (int *i) {
1336
+ int &&j = (int &&)*i;
1337
+ // expected-note@-1 {{binding a reference to dereferenced null pointer is not allowed in a constant expression}}
1338
+ return true ;
1339
+ }
1340
+ static_assert (foo_rvalue(nullptr ), " " ); // expected-note {{in call to 'foo_rvalue(nullptr)'}}
1341
+ // expected-error@-1 {{static assertion expression is not an integral constant expression}}
1342
+
1335
1343
int arr[3 ]; // expected-note {{declared here}}
1336
1344
constexpr bool f () { // cxx14_20-error {{constexpr function never produces a constant expression}}
1337
1345
int &r = arr[3 ]; // cxx14_20-note {{binding a reference to dereferenced one-past-the-end pointer is not allowed in a constant expression}} \
You can’t perform that action at this time.
0 commit comments