rsmith added inline comments.

================
Comment at: lib/Parse/ParseExpr.cpp:203-222
+  // Create the ExpressionEvaluationContext on the stack - but only if asked 
to.
+  struct EnterExpressionEvaluationContextConditionalRAII {
+    llvm::AlignedCharArray<alignof(EnterExpressionEvaluationContext),
+                           sizeof(EnterExpressionEvaluationContext)>
+        MyStackStorage;
+    const EnterExpressionEvaluationContext *const ConstantEvaluatedContext;
+    EnterExpressionEvaluationContextConditionalRAII(bool CreateIt,
----------------
This seems more complexity than we need. How about factoring out a 
`ParseConstantExpressionInExprEvalContext` function that doesn't create a 
context, and then calling it from this function after creating the context?


================
Comment at: lib/Parse/ParseTemplate.cpp:1208-1233
   if (isCXXTypeId(TypeIdAsTemplateArgument)) {
     SourceLocation Loc = Tok.getLocation();
-    TypeResult TypeArg = ParseTypeName(/*Range=*/nullptr,
-                                       Declarator::TemplateTypeArgContext);
+    TypeResult TypeArg =
+        ParseTypeName(/*Range=*/nullptr, Declarator::TemplateTypeArgContext);
     if (TypeArg.isInvalid())
       return ParsedTemplateArgument();
+
----------------
There's a bunch of whitespace changes here. I have no objection to them but 
they should be handled separately rather than mixed into this change.


https://reviews.llvm.org/D31588



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

Reply via email to