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 | 2b64239a8ef4829be7b2c32eff60d8de204b4e2c (patch) | |
tree | d02aff7e9c6f810202ac2f66344a9b0faea8d291 /test/SemaCXX/anonymous-union.cpp | |
parent | f765d76407d82e629337bba4ca6c26bdfc8bc9a6 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/anonymous-union.cpp')
-rw-r--r-- | test/SemaCXX/anonymous-union.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/SemaCXX/anonymous-union.cpp b/test/SemaCXX/anonymous-union.cpp index 5f84bcca28..553ae658e5 100644 --- a/test/SemaCXX/anonymous-union.cpp +++ b/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; + }; + } +} |