Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1y/constexpr-nsdmi2.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
rev | line source |
---|---|
152 | 1 // PR c++/94205 |
2 // { dg-do compile { target c++14 } } | |
3 | |
4 struct S | |
5 { | |
6 struct A | |
7 { | |
8 S *p; | |
9 constexpr A(S* p): p(p) {} | |
10 constexpr operator int() { p->i = 5; return 6; } | |
11 }; | |
12 int i; | |
13 int a = A(this); | |
14 }; | |
15 | |
16 | |
17 constexpr S s = {}; | |
18 | |
19 #define SA(X) static_assert((X),#X) | |
20 SA(s.i == 5 && s.a == 6); |