Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp1y/static_assert3.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 // { dg-do compile { target c++11 } } | |
2 // { dg-options "-fdiagnostics-show-caret" } | |
3 | |
4 class is_not_empty | |
5 { | |
6 int i; | |
7 }; | |
8 | |
9 /* Verify location of static_assert failure (and of traits). */ | |
10 | |
11 static_assert(__is_empty(is_not_empty), "message"); // { dg-error "static assertion failed: message" } | |
12 /* { dg-begin-multiline-output "" } | |
13 static_assert(__is_empty(is_not_empty), "message"); | |
14 ^~~~~~~~~~~~~~~~~~~~~~~~ | |
15 { dg-end-multiline-output "" } */ | |
16 | |
17 | |
18 /* Again, this time verifying location of "noexcept". */ | |
19 | |
20 extern void might_throw (); | |
21 | |
22 static_assert(noexcept(might_throw ()), "message"); // { dg-error "static assertion failed: message" } | |
23 /* { dg-begin-multiline-output "" } | |
24 static_assert(noexcept(might_throw ()), "message"); | |
25 ^~~~~~~~~~~~~~~~~~~~~~~~ | |
26 { dg-end-multiline-output "" } */ |