aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-class.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parser/cxx-class.cpp')
-rw-r--r--test/Parser/cxx-class.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/test/Parser/cxx-class.cpp b/test/Parser/cxx-class.cpp
index 5fac79728579..80cd8288011d 100644
--- a/test/Parser/cxx-class.cpp
+++ b/test/Parser/cxx-class.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
+// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -fcxx-exceptions %s
class C;
class C {
public:
@@ -113,6 +113,32 @@ namespace PR13775 {
}
}
+class pr16989 {
+ void tpl_mem(int *) {
+ return;
+ class C2 {
+ void f();
+ };
+ void C2::f() {} // expected-error{{function definition is not allowed here}}
+ };
+};
+
+namespace CtorErrors {
+ struct A {
+ A(NonExistent); // expected-error {{unknown type name 'NonExistent'}}
+ };
+ struct B {
+ B(NonExistent) : n(0) {} // expected-error {{unknown type name 'NonExistent'}}
+ int n;
+ };
+ struct C {
+ C(NonExistent) try {} catch (...) {} // expected-error {{unknown type name 'NonExistent'}}
+ };
+ struct D {
+ D(NonExistent) {} // expected-error {{unknown type name 'NonExistent'}}
+ };
+}
+
// PR11109 must appear at the end of the source file
class pr11109r3 { // expected-note{{to match this '{'}}
public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}}