summaryrefslogtreecommitdiffstats
path: root/clang
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
commitc08fa185961a38a1d972ccc7267206d0382f81f3 (patch)
tree048033cb3c3341a958daa3d112887139c5f64aa9 /clang
parentaff2a269e315c66c4bf69c4e18114a801b3cfc43 (diff)
downloadbcm5719-llvm-c08fa185961a38a1d972ccc7267206d0382f81f3.tar.gz
bcm5719-llvm-c08fa185961a38a1d972ccc7267206d0382f81f3.zip
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. llvm-svn: 168124
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index 98da920a8fa..7a12c4da951 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud