]> granicus.if.org Git - clang/commitdiff
Fix anon union member assignment expression's location.
authorDevang Patel <dpatel@apple.com>
Tue, 12 Oct 2010 23:23:25 +0000 (23:23 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 12 Oct 2010 23:23:25 +0000 (23:23 +0000)
This is tested by anon-union.exp in gdb testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116371 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 514d9ba3f2fa7bdcf1d0246765398c7298486172..68bb2b072339ddd094f924fd1442d23c8e066451 100644 (file)
@@ -570,7 +570,7 @@ Sema::BuildAnonymousStructUnionMemberReference(SourceLocation Loc,
     // therefore, not part of another non-anonymous record).
     MarkDeclarationReferenced(Loc, BaseObject);
     BaseObjectExpr = new (Context) DeclRefExpr(BaseObject,BaseObject->getType(),
-                                               SourceLocation());
+                                               Loc);
     BaseQuals
       = Context.getCanonicalType(BaseObject->getType()).getQualifiers();
   } else if (BaseObjectExpr) {