annotate gcc/testsuite/g++.dg/cpp1y/constexpr-new.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile { target c++14 } }
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 // { dg-additional-options "-fdelete-null-pointer-checks" }
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 constexpr int *f4(bool b) {
kono
parents:
diff changeset
5 if (b) {
kono
parents:
diff changeset
6 return nullptr;
kono
parents:
diff changeset
7 } else {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
8 return new int{42}; // { dg-error "call to non-.constexpr." "" { target c++17_down } }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 } // { dg-error "is not a constant expression because allocated storage has not been deallocated" "" { target c++2a } .-1 }
111
kono
parents:
diff changeset
10 }
kono
parents:
diff changeset
11 static_assert(f4(true) == nullptr, "");
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
12 static_assert(f4(false) == nullptr, ""); // { dg-error "non-.constant. condition|" }