Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1y/constexpr-copy3.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 // PR c++/69995 |
2 // { dg-do compile { target c++14 } } | |
3 | |
4 struct A | |
5 { | |
6 int i; | |
7 }; | |
8 | |
9 constexpr int f(A a) | |
10 { | |
11 ++a.i; | |
12 return a.i; | |
13 } | |
14 | |
15 constexpr bool g() | |
16 { | |
17 A a = { 42 }; | |
18 A b = a; | |
19 ++b.i; | |
20 if (b.i != 43) return false; | |
21 if (a.i != 42) return false; | |
22 return true; | |
23 } | |
24 | |
25 #define SA(X) static_assert((X),#X) | |
26 SA(g()); |