summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/using-decl-1.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-17 12:57:21 +0000
committerAlp Toker <alp@nuanti.com>2014-01-17 12:57:21 +0000
commit320374c4b167d61a7ae0dbbc73028cf67a357ddb (patch)
tree1581a0ee1e455cc1cfc604d91d147c420ca57694 /clang/test/SemaCXX/using-decl-1.cpp
parentbf2b652c05fbfd3b79381220726d4584a063eef3 (diff)
downloadbcm5719-llvm-320374c4b167d61a7ae0dbbc73028cf67a357ddb.tar.gz
bcm5719-llvm-320374c4b167d61a7ae0dbbc73028cf67a357ddb.zip
Permit redeclaration of tags introduced by using decls
This valid construct appears in MSVC headers where it's used to provide a definition for the '::type_info' compiler builtin type. llvm-svn: 199490
Diffstat (limited to 'clang/test/SemaCXX/using-decl-1.cpp')
-rw-r--r--clang/test/SemaCXX/using-decl-1.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/using-decl-1.cpp b/clang/test/SemaCXX/using-decl-1.cpp
index 24d92f175c3..ed5cce7c974 100644
--- a/clang/test/SemaCXX/using-decl-1.cpp
+++ b/clang/test/SemaCXX/using-decl-1.cpp
@@ -119,6 +119,27 @@ namespace foo
};
}
+namespace using_tag_redeclaration
+{
+ struct S;
+ namespace N {
+ using ::using_tag_redeclaration::S;
+ struct S {}; // expected-note {{previous definition is here}}
+ }
+ void f() {
+ N::S s1;
+ S s2;
+ }
+ void g() {
+ struct S; // expected-note {{forward declaration of 'S'}}
+ S s3; // expected-error {{variable has incomplete type 'S'}}
+ }
+ void h() {
+ using ::using_tag_redeclaration::S;
+ struct S {}; // expected-error {{redefinition of 'S'}}
+ }
+}
+
// Don't suggest non-typenames for positions requiring typenames.
namespace using_suggestion_tyname_val {
namespace N { void FFF() {} }
OpenPOWER on IntegriCloud