diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-23 14:26:01 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-23 14:26:01 +0000 |
commit | e619e99a1b4d14862c96f3e90a429a8d1e3a4875 (patch) | |
tree | d1e4282c8a8456a43f9a1fb3f97728ffaeb1268f /clang/test/SemaCXX/anonymous-union.cpp | |
parent | 381f98e499df3776bfeb46ae4fff6e0b47e69f5e (diff) | |
download | bcm5719-llvm-e619e99a1b4d14862c96f3e90a429a8d1e3a4875.tar.gz bcm5719-llvm-e619e99a1b4d14862c96f3e90a429a8d1e3a4875.zip |
Fix bogus compiler errors when declaring anonymous union, outside a class, with
members with the same name as a decl outside the scope where the members are actually introduced.
Fixes http://llvm.org/PR6741
llvm-svn: 114641
Diffstat (limited to 'clang/test/SemaCXX/anonymous-union.cpp')
-rw-r--r-- | clang/test/SemaCXX/anonymous-union.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/anonymous-union.cpp b/clang/test/SemaCXX/anonymous-union.cpp index 5f84bcca28d..553ae658e53 100644 --- a/clang/test/SemaCXX/anonymous-union.cpp +++ b/clang/test/SemaCXX/anonymous-union.cpp @@ -155,3 +155,23 @@ namespace test4 { (void) a.us1; // expected-error {{private member}} } } + +typedef void *voidPtr; + +void f2() { + union { int **ctxPtr; void **voidPtr; }; +} + +void foo_PR6741() { + union { + char *m_a; + int *m_b; + }; + + if(1) { + union { + char *m_a; + int *m_b; + }; + } +} |