Commit 001ee39a by Paolo Carlini Committed by Paolo Carlini

re PR c++/80739 (Accessing value of X through a Y glvalue in a constant expression)

2017-10-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/80739
	* g++.dg/cpp1y/constexpr-80739.C: New.

From-SVN: r254138
parent ddcb1c88
2017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80739
* g++.dg/cpp1y/constexpr-80739.C: New.
2017-10-27 Richard Biener <rguenther@suse.de>
PR middle-end/81659
......
// PR c++/80739
// { dg-do compile { target c++14 } }
using size_t = decltype(sizeof(0));
template <class T> struct element {
constexpr element() noexcept: x0(0), x1(0), x2(0), x3(0) {}
T x0; int x1, x2, x3;
};
template <class T> struct container {
constexpr container() noexcept: data() {data = element<T>();}
element<T> data;
};
template <class T> constexpr bool test() {
return (container<T>(), true);
}
int main() {
constexpr bool tmp0 = test<int>();
constexpr bool tmp1 = test<size_t>();
return tmp0 && tmp1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment