aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-25 17:51:48 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-25 17:51:48 +0000
commitae201f75e56f33278b2d48396b35bfa74c32af63 (patch)
tree5382f98a8c1f52cc497e23895a09d7abba3fef7a
parent73b3cf6503f72f054288cf474e1a8c8ae56383c2 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124199 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/TreeTransform.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index 3390dd7bad..654bf90e87 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -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() {