diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-10-24 19:49:04 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-10-24 19:49:04 +0000 |
commit | 922ad9fd8cbc6ff437669d676e10493e8fcece7e (patch) | |
tree | 191c37e3979743435ed690c9f23812059200b473 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 838307b31f7ecbca87fe675d6d4c9afc3eb03a40 (diff) | |
download | bcm5719-llvm-922ad9fd8cbc6ff437669d676e10493e8fcece7e.tar.gz bcm5719-llvm-922ad9fd8cbc6ff437669d676e10493e8fcece7e.zip |
CodeGen: GLValue exprs in template parameters should have reference type
This fixes a corner-case where __uuidof as a template argument would
result in us trying to emit a GLValue as an RValue. This would lead to
a crash down the road.
llvm-svn: 220585
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index a5ad633233e..92c2a9bce35 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1324,6 +1324,8 @@ CollectTemplateParams(const TemplateParameterList *TPList, case TemplateArgument::Expression: { const Expr *E = TA.getAsExpr(); QualType T = E->getType(); + if (E->isGLValue()) + T = CGM.getContext().getLValueReferenceType(T); llvm::Value *V = CGM.EmitConstantExpr(E, T); assert(V && "Expression in template argument isn't constant"); llvm::DIType TTy = getOrCreateType(T, Unit); |