[cfe-commits] r124199 - /cfe/trunk/lib/Sema/TreeTransform.h

Douglas Gregor dgregor at apple.com
Tue Jan 25 09:51:48 PST 2011


Author: dgregor
Date: Tue Jan 25 11:51:48 2011
New Revision: 124199

URL: http://llvm.org/viewvc/llvm-project?rev=124199&view=rev
Log:
Be a bit more defensive about setting the temporary base location
during template instantiation. This code needs to eventually die, but
this little tweak fixes PR8629, where bad location information slipped
through to the location of a class template instantiation.

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=124199&r1=124198&r2=124199&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Tue Jan 25 11:51:48 2011
@@ -169,7 +169,9 @@
                   DeclarationName Entity) : Self(Self) {
       OldLocation = Self.getDerived().getBaseLocation();
       OldEntity = Self.getDerived().getBaseEntity();
-      Self.getDerived().setBase(Location, Entity);
+      
+      if (Location.isValid())
+        Self.getDerived().setBase(Location, Entity);
     }
 
     ~TemporaryBase() {





More information about the cfe-commits mailing list