1 // Bug c++/83871 - wrong code due to attributes on distinct template
3 // Test to verify that an explicit template specifialization does not
4 // "inherit" attribute nothrow from a primary template declared with one.
6 // { dg-options "-O -Wall -fdump-tree-optimized" }
9 void __attribute__ ((nothrow))
15 void f_void_nothrow ();
16 void f_int_maythrow ();
24 catch (...) // cannot be be reached
26 f_void_nothrow (); // should be eliminated
37 catch (...) // may be reached
39 f_int_maythrow (); // must not be eliminated
43 // Verify that the call to f_void_nothrow() is eliminated but
44 // the call to f_int_maythrow() is retained.
45 // { dg-final { scan-tree-dump-not "f_void_nothrow" "optimized" } }
46 // { dg-final { scan-tree-dump-times "f_int_maythrow" 1 "optimized" } }