1 // RUN: %clang_cc1 -std=c++11 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
3 // Compatibility of virtual functions.
27 virtual void f1() throw();
28 virtual void f2() throw(int, float);
30 virtual void f3() throw(int, float);
31 virtual void f4() throw(A
);
32 virtual void f5() throw(A
, int, float);
35 virtual void f7() noexcept
;
36 virtual void f8() noexcept
;
37 virtual void f9() noexcept(false);
38 virtual void f10() noexcept(false);
40 virtual void f11() throw();
41 virtual void f12() noexcept
;
42 virtual void f13() noexcept(false);
43 virtual void f14() throw(int);
48 virtual void g1() throw(); // expected-note {{overridden virtual function is here}}
49 virtual void g2() throw(int); // expected-note {{overridden virtual function is here}}
50 virtual void g3() throw(A
); // expected-note {{overridden virtual function is here}}
51 virtual void g4() throw(B1
); // expected-note {{overridden virtual function is here}}
52 virtual void g5() throw(A
); // expected-note {{overridden virtual function is here}}
54 virtual void g6() noexcept
; // expected-note {{overridden virtual function is here}}
55 virtual void g7() noexcept
; // expected-note {{overridden virtual function is here}}
57 virtual void g8() noexcept
; // expected-note {{overridden virtual function is here}}
58 virtual void g9() throw(); // expected-note {{overridden virtual function is here}}
59 virtual void g10() throw(int); // expected-note {{overridden virtual function is here}}
63 virtual void f1() throw();
64 virtual void f2() throw(float, int);
66 virtual void f3() throw(float);
67 virtual void f4() throw(B1
);
68 virtual void f5() throw(B1
, B2
, int);
69 virtual void f6() throw(B2
, B2
, int, float, char, double, bool);
71 virtual void f7() noexcept
;
72 virtual void f8() noexcept(true);
73 virtual void f9() noexcept(true);
74 virtual void f10() noexcept(false);
76 virtual void f11() noexcept
;
77 virtual void f12() throw();
78 virtual void f13() throw(int);
79 virtual void f14() noexcept(true);
81 virtual void f15() noexcept
;
82 virtual void f16() throw();
84 virtual void g1() throw(int); // expected-error {{exception specification of overriding function is more lax}}
85 virtual void g2(); // expected-error {{exception specification of overriding function is more lax}}
86 virtual void g3() throw(D
); // expected-error {{exception specification of overriding function is more lax}}
87 virtual void g4() throw(A
); // expected-error {{exception specification of overriding function is more lax}}
88 virtual void g5() throw(P
); // expected-error {{exception specification of overriding function is more lax}}
90 virtual void g6() noexcept(false); // expected-error {{exception specification of overriding function is more lax}}
91 virtual void g7(); // expected-error {{exception specification of overriding function is more lax}}
93 virtual void g8() throw(int); // expected-error {{exception specification of overriding function is more lax}}
94 virtual void g9() noexcept(false); // expected-error {{exception specification of overriding function is more lax}}
95 virtual void g10() noexcept(false); // expected-error {{exception specification of overriding function is more lax}}