faisalv added inline comments.

================
Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:2114
@@ -2113,1 +2113,3 @@
+    EnterExpressionEvaluationContext ConstantEvaluated(SemaRef,
+                                                       
Sema::ConstantEvaluated);
     ExprResult Value = SemaRef.SubstExpr(D->getDefaultArgument(), 
TemplateArgs);
----------------
Looks reasonable to me - since it is consistent with the other changes I had 
made.  But somewhat orthogonal to your fix, I wouldn't mind Richard commenting 
on why constant expression evaluation does not have 
IsPotentiallyEvaluatedContext return false (and avoid adding an entry to 
MaybeODRUse)
Also, just as SubstituteDefaultTemplateArgument does, Perhaps we should add an 
InstantiatingTemplate on the stack that marks this as a substitution into  
default arguments.  It would be nice if we could refactor both into a call to 
the same function (i.e SubstittueDefaultTempalteArgument) - but looking at the 
code for it, that would be a little tricky.
My 2 cents.


http://reviews.llvm.org/D17576



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to