forked from OSchip/llvm-project
Anonymous union members within a struct are now properly handled as an unevaluated field in C++11 mode. This fixes PR12866.
llvm-svn: 157784
This commit is contained in:
parent
526772de29
commit
a0bc07262b
|
@ -115,7 +115,7 @@ static IMAKind ClassifyImplicitMemberAccess(Sema &SemaRef,
|
|||
NamedDecl *D = *I;
|
||||
|
||||
if (D->isCXXInstanceMember()) {
|
||||
if (dyn_cast<FieldDecl>(D))
|
||||
if (dyn_cast<FieldDecl>(D) || dyn_cast<IndirectFieldDecl>(D))
|
||||
isField = true;
|
||||
|
||||
CXXRecordDecl *R = cast<CXXRecordDecl>(D->getDeclContext());
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -pedantic %s
|
||||
|
||||
namespace PR12866 {
|
||||
struct bar {
|
||||
union {
|
||||
int member;
|
||||
};
|
||||
};
|
||||
|
||||
void foo( void ) {
|
||||
(void)sizeof(bar::member);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue