xref: /minix3/external/bsd/llvm/dist/clang/test/SemaCXX/exception-spec-no-exceptions.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fobjc-exceptions %s
2*f4a2713aSLionel Sambuc // expected-no-diagnostics
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc // Note that we're specifically excluding -fcxx-exceptions in the command line above.
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc // That this should work even with -fobjc-exceptions is PR9358
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc // PR7243: redeclarations
9*f4a2713aSLionel Sambuc namespace test0 {
10*f4a2713aSLionel Sambuc   void foo() throw(int);
11*f4a2713aSLionel Sambuc   void foo() throw();
12*f4a2713aSLionel Sambuc }
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc // Overrides.
15*f4a2713aSLionel Sambuc namespace test1 {
16*f4a2713aSLionel Sambuc   struct A {
17*f4a2713aSLionel Sambuc     virtual void foo() throw();
18*f4a2713aSLionel Sambuc   };
19*f4a2713aSLionel Sambuc 
20*f4a2713aSLionel Sambuc   struct B : A {
21*f4a2713aSLionel Sambuc     virtual void foo() throw(int);
22*f4a2713aSLionel Sambuc   };
23*f4a2713aSLionel Sambuc }
24*f4a2713aSLionel Sambuc 
25*f4a2713aSLionel Sambuc // Calls from less permissive contexts.  We don't actually do this
26*f4a2713aSLionel Sambuc // check, but if we did it should also be disabled under
27*f4a2713aSLionel Sambuc // -fno-exceptions.
28*f4a2713aSLionel Sambuc namespace test2 {
29*f4a2713aSLionel Sambuc   void foo() throw(int);
bar()30*f4a2713aSLionel Sambuc   void bar() throw() {
31*f4a2713aSLionel Sambuc     foo();
32*f4a2713aSLionel Sambuc   }
33*f4a2713aSLionel Sambuc }
34*f4a2713aSLionel Sambuc 
35