Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp0x/pr85437-1.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line source
// PR c++/85437 // { dg-do compile { target c++11 } } struct A { int a; constexpr A() : a(0) {} }; struct B : A { int x; constexpr B() : x(0) {} }; struct X { int z; constexpr X() : z(0) {} }; struct C : X, B {}; constexpr int C::*cbx = &B::x; constexpr int B::*bx = &B::x; constexpr int A::*abx = static_cast<int(A::*)>(&B::x); // { dg-bogus "not a constant expression" } constexpr const C y; constexpr const B& yb = y; constexpr const A& ya = y; constexpr int const *pcbx = &(y.*cbx); constexpr int const *pbx = &(y.*bx); constexpr int const *pabx = &(ya.*abx);