summaryrefslogtreecommitdiffstats
path: root/test/Parser/cxx-decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parser/cxx-decl.cpp')
-rw-r--r--test/Parser/cxx-decl.cpp49
1 files changed, 47 insertions, 2 deletions
diff --git a/test/Parser/cxx-decl.cpp b/test/Parser/cxx-decl.cpp
index 41d305b..8c4c617 100644
--- a/test/Parser/cxx-decl.cpp
+++ b/test/Parser/cxx-decl.cpp
@@ -108,9 +108,9 @@ template<class T>
class Class1;
class Class2 {
-} // no ;
+} // expected-error {{expected ';' after class}}
-typedef Class1<Class2> Type1; // expected-error {{cannot combine with previous 'class' declaration specifier}}
+typedef Class1<Class2> Type1;
// rdar : // 8307865
struct CodeCompleteConsumer {
@@ -187,6 +187,51 @@ namespace PR15017 {
// Ensure we produce at least some diagnostic for attributes in C++98.
[[]] struct S; // expected-error 2{{}}
+namespace test7 {
+ struct Foo {
+ void a();
+ void b();
+ };
+
+ void Foo::
+ // Comment!
+ a() {}
+
+
+ void Foo:: // expected-error {{expected unqualified-id}}
+ // Comment!
+}
+
+void test8() {
+ struct {} o;
+ // This used to crash.
+ (&o)->(); // expected-error{{expected unqualified-id}}
+}
+
+namespace PR5066 {
+ template<typename T> struct X {};
+ X<int N> x; // expected-error {{type-id cannot have a name}}
+
+ using T = int (*T)(); // expected-error {{type-id cannot have a name}} expected-warning {{C++11}}
+}
+
+namespace PR17255 {
+void foo() {
+ typename A::template B<>; // expected-error {{use of undeclared identifier 'A'}} \
+ // expected-error {{expected a qualified name after 'typename'}} \
+ // expected-warning {{'template' keyword outside of a template}}
+}
+}
+
+namespace PR17567 {
+ struct Foobar { // expected-note 2{{declared here}}
+ FooBar(); // expected-error {{missing return type for function 'FooBar'; did you mean the constructor name 'Foobar'?}}
+ ~FooBar(); // expected-error {{expected the class name after '~' to name a destructor}}
+ };
+ FooBar::FooBar() {} // expected-error {{undeclared}} expected-error {{missing return type}}
+ FooBar::~FooBar() {} // expected-error {{undeclared}} expected-error {{expected the class name}}
+}
+
// PR8380
extern "" // expected-error {{unknown linkage language}}
test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} \
OpenPOWER on IntegriCloud