| 1 |
// Copyright (C) 2004 Free Software Foundation, Inc. |
| 2 |
// Contributed by Nathan Sidwell 15 Oct 2004 <[email protected]> |
| 3 |
|
| 4 |
// We forgot to ignore current context and friends when determing |
| 5 |
// which exceptions shadowed eachother. |
| 6 |
|
| 7 |
struct E; |
| 8 |
|
| 9 |
struct B {}; |
| 10 |
|
| 11 |
struct D : private B |
| 12 |
{ |
| 13 |
friend class E; |
| 14 |
|
| 15 |
static B *baz (D *); |
| 16 |
virtual void V () throw (B); // { dg-message "overridden" "" { target { ! c++17 } } } |
| 17 |
}; // { dg-error "dynamic exception specification" "" { target c++17 } .-1 } |
| 18 |
// { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } .-2 } |
| 19 |
struct E : public D |
| 20 |
{ |
| 21 |
virtual void V () throw (D); // { dg-error "looser exception" "" { target { ! c++17 } } } |
| 22 |
}; // { dg-error "dynamic exception specification" "" { target c++17 } .-1 } |
| 23 |
// { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } .-2 } |
| 24 |
B* foo (D *); |
| 25 |
|
| 26 |
B *D::baz (D *p) |
| 27 |
{ |
| 28 |
try {foo (p);} |
| 29 |
catch (B const &b) {} |
| 30 |
catch (D const &d) {} |
| 31 |
return p; |
| 32 |
} |