annotate gcc/testsuite/g++.dg/cpp0x/defaulted23.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // Test for checking of exception specifications on defaulted fns
kono
parents:
diff changeset
2 // { dg-do compile { target c++11 } }
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 struct A
kono
parents:
diff changeset
5 {
kono
parents:
diff changeset
6 A() noexcept = default;
kono
parents:
diff changeset
7 };
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 A a;
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 struct B
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 B() throw (int) = default; // { dg-message "exception-specification" "" { target { ! c++17 } } }
kono
parents:
diff changeset
14 }; // { dg-error "dynamic exception specification" "" { target c++17 } .-1 }
kono
parents:
diff changeset
15 // { dg-warning "deprecated" "" { target { ! c++17 } } .-2 }
kono
parents:
diff changeset
16 B b; // { dg-error "deleted" "" { target { ! c++17 } } }
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 struct C
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 C() throw (int) { } // { dg-error "dynamic exception specification" "" { target c++17 } }
kono
parents:
diff changeset
21 }; // { dg-warning "deprecated" "" { target { ! c++17 } } .-1 }
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 C c;
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 struct D: C
kono
parents:
diff changeset
26 {
kono
parents:
diff changeset
27 D() throw (int) = default; // { dg-error "dynamic exception specification" "" { target c++17 } }
kono
parents:
diff changeset
28 }; // { dg-warning "deprecated" "" { target { ! c++17 } } .-1 }
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 D d;
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 struct E
kono
parents:
diff changeset
33 {
kono
parents:
diff changeset
34 E() = default;
kono
parents:
diff changeset
35 };
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 E e;