PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / depr-copy1.C
blobd33c6dc667db8e9b1d7a30afc57a3093eb967ca6
1 /* [depr.impldec] The implicit definition of a copy constructor as defaulted is
2    deprecated if the class has a user-declared copy assignment operator or a
3    user-declared destructor. The implicit definition of a copy assignment
4    operator as defaulted is deprecated if the class has a user-declared copy
5    constructor or a user-declared destructor (15.4, 15.8). In a future revision
6    of this International Standard, these implicit definitions could become
7    deleted (11.4).  */
9 // { dg-additional-options -Wdeprecated-copy }
11 struct X
13   X();
14   X(const X&);
16 struct A
18   X x;
19   ~A();
22 void f(bool b)
24   A a;
25   if (b)
26     throw A();                  // Don't warn about elided copy
27   A a2 = A();                   // Here either.
28   A a3 (a);                     // { dg-warning "deprecated" "" { target c++11 } }