diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/struct-class-redecl.cpp | 8 | ||||
-rw-r--r-- | clang/test/SemaCXX/typedef-redecl.cpp | 2 | ||||
-rw-r--r-- | clang/test/SemaTemplate/class-template-decl.cpp | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/clang/test/SemaCXX/struct-class-redecl.cpp b/clang/test/SemaCXX/struct-class-redecl.cpp new file mode 100644 index 00000000000..d6ac3661a39 --- /dev/null +++ b/clang/test/SemaCXX/struct-class-redecl.cpp @@ -0,0 +1,8 @@ +// RUN: clang-cc -fsyntax-only -verify %s +class X; // expected-note{{here}} +typedef struct X * X_t; + +template<typename T> class Y; +template<class U> struct Y { }; + +union X { int x; float y; }; // expected-error{{use of 'X' with tag type that does not match previous declaration}} diff --git a/clang/test/SemaCXX/typedef-redecl.cpp b/clang/test/SemaCXX/typedef-redecl.cpp index 10be77cd1a6..e38f47436d1 100644 --- a/clang/test/SemaCXX/typedef-redecl.cpp +++ b/clang/test/SemaCXX/typedef-redecl.cpp @@ -29,5 +29,3 @@ typedef I I; struct s { }; -typedef class st { /* ... */ } st; // expected-note{{previous use is here}} -struct st; // expected-error{{use of 'st' with tag type that does not match previous declaration}} diff --git a/clang/test/SemaTemplate/class-template-decl.cpp b/clang/test/SemaTemplate/class-template-decl.cpp index 475c7b95192..c8126777129 100644 --- a/clang/test/SemaTemplate/class-template-decl.cpp +++ b/clang/test/SemaTemplate/class-template-decl.cpp @@ -14,13 +14,10 @@ extern "C" { template<typename T> class D; // expected-error{{templates must have C++ linkage}} } -template<class U> class A; // expected-note{{previous template declaration is here}}\ - // expected-note{{previous use is here}} +template<class U> class A; // expected-note{{previous template declaration is here}} template<int N> class A; // expected-error{{template parameter has a different kind in template redeclaration}} -template<class T> struct A; // expected-error{{use of 'A' with tag type that does not match previous declaration}} - template<int N> class NonTypeTemplateParm; typedef int INT; |