Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp0x/anon-union1.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// PR c++/66583 // { dg-do run { target c++11 } } template <class T> T&& move(T& t) { return static_cast<T&&>(t); } struct A { A() { }; A(const A&) { } }; struct B { union { int m_1 = 0; int m_2; }; A dummy; }; int main() { B b; b.m_1 = 1; B c = move(b); if (c.m_1 != 1) __builtin_abort(); }