Debian Codegraph @

gcc/testsuite/g++.dg/warn/Wexceptions2.C

raw
1 // PR c++/97675
2 // { dg-additional-options -Wno-exceptions }
3
4 struct Base { };
5 struct Child : Base { };
6 int main() {
7 try { throw Child(); }
8 catch (Base const&) { }
9 catch (Child const&) { } // { dg-bogus "exception of type .Child. will be caught by earlier handler" }
10 }