When rebuilding a MemberExpr that refers to an anonymous union, be

sure to perform derived-to-base conversions on the base
expression. Fixes PR5868. Proper testcase is coming soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92139 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Douglas Gregor 2009-12-24 20:02:50 +00:00
Родитель f3c47c9525
Коммит 83a56c4a1d
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -956,8 +956,11 @@ public:
// We have a reference to an unnamed field.
assert(!Qualifier && "Can't have an unnamed field with a qualifier!");
Expr *BaseExpr = Base.takeAs<Expr>();
if (getSema().PerformObjectMemberConversion(BaseExpr, Member))
return getSema().ExprError();
MemberExpr *ME =
new (getSema().Context) MemberExpr(Base.takeAs<Expr>(), isArrow,
new (getSema().Context) MemberExpr(BaseExpr, isArrow,
Member, MemberLoc,
cast<FieldDecl>(Member)->getType());
return getSema().Owned(ME);