diff options
author | Alp Toker <alp@nuanti.com> | 2014-01-18 00:59:32 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-01-18 00:59:32 +0000 |
commit | 0abb05771500eee8c6e39f4f4646a8de8403c491 (patch) | |
tree | 27e8f7c3583707917b1f4880f34445c3685ef2e1 /clang/test/SemaCXX/MicrosoftCompatibility.cpp | |
parent | 8d7a6f289866e1c1c04005ae3cbdc052c342488e (diff) | |
download | bcm5719-llvm-0abb05771500eee8c6e39f4f4646a8de8403c491.tar.gz bcm5719-llvm-0abb05771500eee8c6e39f4f4646a8de8403c491.zip |
Restrict redeclaration of tags introduced by using decls to MSVCCompat
This limits the facility added in r199490 while we seek clarification on the
standard.
llvm-svn: 199531
Diffstat (limited to 'clang/test/SemaCXX/MicrosoftCompatibility.cpp')
-rw-r--r-- | clang/test/SemaCXX/MicrosoftCompatibility.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/MicrosoftCompatibility.cpp b/clang/test/SemaCXX/MicrosoftCompatibility.cpp index 1f27deb0ee1..0971646e73b 100644 --- a/clang/test/SemaCXX/MicrosoftCompatibility.cpp +++ b/clang/test/SemaCXX/MicrosoftCompatibility.cpp @@ -120,6 +120,27 @@ private: } +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'}} + } +} + namespace MissingTypename { |