Mercurial > hg > CbC > CbC_gcc
annotate 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 |
rev | line source |
---|---|
111 | 1 // { dg-do compile { target c++14 } } |
2 | |
3 constexpr int *f4(bool b) { | |
4 if (b) { | |
5 return nullptr; | |
6 } else { | |
131 | 7 return new int{42}; // { dg-error "call to non-.constexpr." } |
111 | 8 } |
9 } | |
10 static_assert(f4(true) == nullptr, ""); | |
131 | 11 static_assert(f4(false) == nullptr, ""); // { dg-error "non-.constant. condition|" } |