ryee88 updated this revision to Diff 47922.
ryee88 added a comment.

Added unit tests.


http://reviews.llvm.org/D16965

Files:
  test/Parser/forward-declaration.cpp

Index: test/Parser/forward-declaration.cpp
===================================================================
--- /dev/null
+++ test/Parser/forward-declaration.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+
+class Outer {class Inner;};
+
+class ::Outer; // expected-error {{forward declaration of qualified class not 
allowed}} expected-warning {{extra qualification on member 'Outer'}}
+
+class Outer;
+
+// specializations of qualified type introduction?
+class Outer::Inner; // expected-error {{forward declaration of class cannot 
have a nested name specifier}}
+class ::Outer::Inner; // expected-error {{forward declaration of class cannot 
have a nested name specifier}}


Index: test/Parser/forward-declaration.cpp
===================================================================
--- /dev/null
+++ test/Parser/forward-declaration.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+
+class Outer {class Inner;};
+
+class ::Outer; // expected-error {{forward declaration of qualified class not allowed}} expected-warning {{extra qualification on member 'Outer'}}
+
+class Outer;
+
+// specializations of qualified type introduction?
+class Outer::Inner; // expected-error {{forward declaration of class cannot have a nested name specifier}}
+class ::Outer::Inner; // expected-error {{forward declaration of class cannot have a nested name specifier}}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to