Mercurial > hg > CbC > CbC_gcc
comparison 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 |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
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); |