annotate gcc/testsuite/g++.dg/eh/shadow1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // Copyright (C) 2004 Free Software Foundation, Inc.
kono
parents:
diff changeset
2 // Contributed by Nathan Sidwell 15 Oct 2004 <nathan@codesourcery.com>
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 // We forgot to ignore current context and friends when determing
kono
parents:
diff changeset
5 // which exceptions shadowed eachother.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct E;
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 struct B {};
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 struct D : private B
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 friend class E;
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 static B *baz (D *);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
16 virtual void V () throw (B); // { dg-message "overridden" "" { target { ! c++17 } } }
111
kono
parents:
diff changeset
17 }; // { dg-error "dynamic exception specification" "" { target c++17 } .-1 }
kono
parents:
diff changeset
18 // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } .-2 }
kono
parents:
diff changeset
19 struct E : public D
kono
parents:
diff changeset
20 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
21 virtual void V () throw (D); // { dg-error "looser exception" "" { target { ! c++17 } } }
111
kono
parents:
diff changeset
22 }; // { dg-error "dynamic exception specification" "" { target c++17 } .-1 }
kono
parents:
diff changeset
23 // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } .-2 }
kono
parents:
diff changeset
24 B* foo (D *);
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 B *D::baz (D *p)
kono
parents:
diff changeset
27 {
kono
parents:
diff changeset
28 try {foo (p);}
kono
parents:
diff changeset
29 catch (B const &b) {}
kono
parents:
diff changeset
30 catch (D const &d) {}
kono
parents:
diff changeset
31 return p;
kono
parents:
diff changeset
32 }