aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2012-11-16 01:14:52 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2012-11-16 01:14:52 +0000
commit0bbf1c668e8cb1a3e5b1385c2fd5cd6c73f481c0 (patch)
tree0c915e3a28f8aae7a65dccf6dc6651cf4716cb4c /lib/AST/MicrosoftMangle.cpp
parent426391cd51af86f9d59eceb0fb1c42153eccbb9a (diff)
Fix PR14321, a crash when Clang is built with GCC 4.7 at -O1 or greater.
GCC 4.7 reuses stack slots fairly aggressively, which exposes more temporary lifetime bugs. No new test, this was caught by the existing CodeGenCXX/mangle-ms-templates.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168124 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/MicrosoftMangle.cpp')
-rw-r--r--lib/AST/MicrosoftMangle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp
index 98da920a8f..7a12c4da95 100644
--- a/lib/AST/MicrosoftMangle.cpp
+++ b/lib/AST/MicrosoftMangle.cpp
@@ -373,7 +373,7 @@ isTemplate(const NamedDecl *ND,
dyn_cast<ClassTemplateSpecializationDecl>(ND)) {
TypeSourceInfo *TSI = Spec->getTypeAsWritten();
if (TSI) {
- TemplateSpecializationTypeLoc &TSTL =
+ TemplateSpecializationTypeLoc TSTL =
cast<TemplateSpecializationTypeLoc>(TSI->getTypeLoc());
TemplateArgumentListInfo LI(TSTL.getLAngleLoc(), TSTL.getRAngleLoc());
for (unsigned i = 0, e = TSTL.getNumArgs(); i != e; ++i)