[PATCH] D19175: Fix for PR27015 (variable template initialized with a generic lambda expression)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 15 13:51:42 PDT 2016


rsmith added inline comments.

================
Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:3899-3901
@@ -3898,5 +3898,5 @@
     // Instantiate the initializer.
     ExprResult Init =
         SubstInitializer(OldVar->getInit(), TemplateArgs,
-                         OldVar->getInitStyle() == VarDecl::CallInit);
+                         OldVar->getInitStyle() == VarDecl::CallInit, Var);
     if (!Init.isInvalid()) {
----------------
Instead of the other changes, switch `CurContext` to the context of the variable template here:

    Sema::ContextRAII SwitchContext(*this, Var->getDeclContext());


http://reviews.llvm.org/D19175





More information about the cfe-commits mailing list