[cfe-commits] r95211 - /cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Douglas Gregor dgregor at apple.com
Wed Feb 3 01:02:03 PST 2010


Author: dgregor
Date: Wed Feb  3 03:01:59 2010
New Revision: 95211

URL: http://llvm.org/viewvc/llvm-project?rev=95211&view=rev
Log:
Look through CXXExprWithTemporaries when digging out the original
initializer. Grrr....

Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=95211&r1=95210&r2=95211&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Wed Feb  3 03:01:59 2010
@@ -241,6 +241,9 @@
     // Extract the initializer, skipping through any temporary-binding 
     // expressions and look at the subexpression as it was written.
     Expr *DInit = D->getInit();
+    if (CXXExprWithTemporaries *ExprTemp
+          = dyn_cast<CXXExprWithTemporaries>(DInit))
+      DInit = ExprTemp->getSubExpr();
     while (CXXBindTemporaryExpr *Binder = dyn_cast<CXXBindTemporaryExpr>(DInit))
       DInit = Binder->getSubExpr();
     if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(DInit))





More information about the cfe-commits mailing list