projects
/
gcc.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
P1008R1 - prohibit aggregates with user-declared constructors
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp2a
/
aggr2.C
1
// { dg-do run { target c++11 } }
2
3
struct A;
4
struct B { operator A (); };
5
struct A { A (const A &) = default; A () = default; B a; };
6
A a {B {}};
7
bool seen;
8
9
B::operator A ()
10
{
11
seen = true;
12
return A ();
13
}
14
15
int
16
main ()
17
{
18
#if __cplusplus > 201703L
19
if (!seen)
20
__builtin_abort ();
21
#else
22
if (seen)
23
__builtin_abort ();
24
#endif
25
}