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) {
13321332static_assert (foo(nullptr ), " " ); // expected-note {{in call to 'foo(nullptr)'}}
13331333// expected-error@-1 {{static assertion expression is not an integral constant expression}}
13341334
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+
13351343int arr[3 ]; // expected-note {{declared here}}
13361344constexpr bool f () { // cxx14_20-error {{constexpr function never produces a constant expression}}
13371345 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