Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / no-exceptions.cpp
blob097123d3fe5236095b2ab0cc86e76ab63d400e14
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // Various tests for -fno-exceptions
5 typedef __SIZE_TYPE__ size_t;
7 namespace test0 {
8 class Foo {
9 public:
10 void* operator new(size_t x);
11 private:
12 void operator delete(void *x);
15 void test() {
16 // Under -fexceptions, this does access control for the associated
17 // 'operator delete'.
18 (void) new Foo();
22 namespace test1 {
23 void f() {
24 throw; // expected-error {{cannot use 'throw' with exceptions disabled}}
27 void g() {
28 try { // expected-error {{cannot use 'try' with exceptions disabled}}
29 f();
30 } catch (...) {