1 // { dg-options "-Wcatch-value=3" }
3 struct A { virtual ~A() {} };
11 catch (D) {} // { dg-warning "catching type" }
12 catch (C) {} // { dg-warning "catching type" }
13 catch (B) {} // { dg-warning "catching polymorphic type" }
14 catch (A) {} // { dg-warning "catching polymorphic type" }
15 catch (A*) {} // { dg-warning "catching non-reference type" }
16 catch (int) {} // { dg-warning "catching non-reference type" }
23 catch (A*) {} // { dg-warning "catching non-reference type" }
27 template<typename T> void foo1()
30 catch (T) {} // { dg-warning "catching" }
33 template<typename T> void foo2()
36 catch (T*) {} // { dg-warning "catching non-reference type" }
53 foo1<int>(); // { dg-message "required" }
54 foo1<A>(); // { dg-message "required" }
55 foo1<B>(); // { dg-message "required" }
56 foo1<C>(); // { dg-message "required" }
57 foo1<D>(); // { dg-message "required" }
59 foo2<int>(); // { dg-message "required" }
60 foo2<A>(); // { dg-message "required" }
61 foo2<B>(); // { dg-message "required" }
62 foo2<C>(); // { dg-message "required" }
63 foo2<D>(); // { dg-message "required" }