aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-class.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2011-10-13 06:08:43 +0000
committerDavid Blaikie <dblaikie@gmail.com>2011-10-13 06:08:43 +0000
commit13f8daf70637f8f295134ac8e089dd7721e09085 (patch)
tree18c0ee01b4b7a86dd5b19a18f8451f08a82363b0 /test/Parser/cxx-class.cpp
parentdac6cec94c23ba7c9021590a88878768abde4f2e (diff)
Fix crash-on-invalid, improve error recovery, and test coverage for missing colon after access specifiers in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-class.cpp')
-rw-r--r--test/Parser/cxx-class.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Parser/cxx-class.cpp b/test/Parser/cxx-class.cpp
index f863bd198e..1c0d862b30 100644
--- a/test/Parser/cxx-class.cpp
+++ b/test/Parser/cxx-class.cpp
@@ -40,3 +40,20 @@ typedef union {
} y;
} bug3177;
+// check that we don't consume the token after the access specifier
+// when it's not a colon
+class D {
+public // expected-error{{expected ':'}}
+ int i;
+};
+
+// consume the token after the access specifier if it's a semicolon
+// that was meant to be a colon
+class E {
+public; // expected-error{{expected ':'}}
+ int i;
+};
+
+// 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}}