]> granicus.if.org Git - clang/commitdiff
Be a bit more defensive about setting the temporary base location
authorDouglas Gregor <dgregor@apple.com>
Tue, 25 Jan 2011 17:51:48 +0000 (17:51 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 25 Jan 2011 17:51:48 +0000 (17:51 +0000)
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.

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

lib/Sema/TreeTransform.h

index 3390dd7badc75384f5c171d9f058cc7968bb3f4a..654bf90e87da09a369fcfd23b5fae9b9544a6191 100644 (file)
@@ -169,7 +169,9 @@ public:
                   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() {