repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR c++/85765 - SFINAE and non-type default template arg.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
anon-union1.C
blob
19f6291211c48cc6faa96dfa96c584d22004b540
1
// PR c++/66583
2
// { dg-do run { target c++11 } }
3
4
template <class T>
5
T&& move(T& t) { return static_cast<T&&>(t); }
6
7
struct A {
8
A() { };
9
A(const A&) { }
10
};
11
12
struct B {
13
union {
14
int m_1 = 0;
15
int m_2;
16
};
17
A dummy;
18
};
19
20
int main()
21
{
22
B b;
23
b.m_1 = 1;
24
B c = move(b);
25
if (c.m_1 != 1)
26
__builtin_abort();
27
}