From e619e99a1b4d14862c96f3e90a429a8d1e3a4875 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Thu, 23 Sep 2010 14:26:01 +0000 Subject: 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 --- clang/test/SemaCXX/anonymous-union.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'clang/test/SemaCXX/anonymous-union.cpp') 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; + }; + } +} -- cgit v1.2.3