From: Paolo Carlini Date: Fri, 27 Oct 2017 08:53:08 +0000 (+0000) Subject: re PR c++/80739 (Accessing value of X through a Y glvalue in a constant expression) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=001ee39a52ec28f2c03bfc7764e30652157b1161;p=gcc.git re PR c++/80739 (Accessing value of X through a Y glvalue in a constant expression) 2017-10-27 Paolo Carlini PR c++/80739 * g++.dg/cpp1y/constexpr-80739.C: New. From-SVN: r254138 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bafe8fda1ef..57a8f44f4cf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-27 Paolo Carlini + + PR c++/80739 + * g++.dg/cpp1y/constexpr-80739.C: New. + 2017-10-27 Richard Biener PR middle-end/81659 diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-80739.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-80739.C new file mode 100644 index 00000000000..5bfa082866a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-80739.C @@ -0,0 +1,20 @@ +// PR c++/80739 +// { dg-do compile { target c++14 } } + +using size_t = decltype(sizeof(0)); +template struct element { + constexpr element() noexcept: x0(0), x1(0), x2(0), x3(0) {} + T x0; int x1, x2, x3; +}; +template struct container { + constexpr container() noexcept: data() {data = element();} + element data; +}; +template constexpr bool test() { + return (container(), true); +} +int main() { + constexpr bool tmp0 = test(); + constexpr bool tmp1 = test(); + return tmp0 && tmp1; +}