Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp1y/constexpr-new.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
2 | 2 |
3 constexpr int *f4(bool b) { | 3 constexpr int *f4(bool b) { |
4 if (b) { | 4 if (b) { |
5 return nullptr; | 5 return nullptr; |
6 } else { | 6 } else { |
7 return new int{42}; // { dg-error "call to non-constexpr" } | 7 return new int{42}; // { dg-error "call to non-.constexpr." } |
8 } | 8 } |
9 } | 9 } |
10 static_assert(f4(true) == nullptr, ""); | 10 static_assert(f4(true) == nullptr, ""); |
11 static_assert(f4(false) == nullptr, ""); // { dg-error "non-constant condition" } | 11 static_assert(f4(false) == nullptr, ""); // { dg-error "non-.constant. condition|" } |