[cfe-commits] r92139 - /cfe/trunk/lib/Sema/TreeTransform.h
Douglas Gregor
dgregor at apple.com
Thu Dec 24 12:02:50 PST 2009
Author: dgregor
Date: Thu Dec 24 14:02:50 2009
New Revision: 92139
URL: http://llvm.org/viewvc/llvm-project?rev=92139&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=92139&r1=92138&r2=92139&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Thu Dec 24 14:02:50 2009
@@ -956,8 +956,11 @@
// 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);
More information about the cfe-commits
mailing list