minix/external/bsd/llvm/dist/clang/test/SemaCXX/exception-spec-no-exceptions.cpp
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

34 lines
719 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fobjc-exceptions %s
// expected-no-diagnostics
// Note that we're specifically excluding -fcxx-exceptions in the command line above.
// That this should work even with -fobjc-exceptions is PR9358
// PR7243: redeclarations
namespace test0 {
void foo() throw(int);
void foo() throw();
}
// Overrides.
namespace test1 {
struct A {
virtual void foo() throw();
};
struct B : A {
virtual void foo() throw(int);
};
}
// Calls from less permissive contexts. We don't actually do this
// check, but if we did it should also be disabled under
// -fno-exceptions.
namespace test2 {
void foo() throw(int);
void bar() throw() {
foo();
}
}