[PATCH] D28510: Reinstate CWG1607 restrictions on lambdas appearing inside certain constant-expressions

Richard Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 23:54:46 PST 2017


rsmith added inline comments.


================
Comment at: include/clang/Parse/Parser.h:1432
+  ExprResult ParseConstantExpression(TypeCastState isTypeCast = NotTypeCast,
+                                     bool IsLambdaExprForbidden = false);
   ExprResult ParseConstraintExpression();
----------------
I would call this `IsInSignature`.


================
Comment at: include/clang/Sema/Sema.h:894-895
 
+    /// \brief Whether lambda expressions are forbidden here.
+    bool IsLambdaExprForbidden;
+
----------------
Rather than adding a flag, how about we have two different kinds of `ExpressionEvaluationContext` for constant expressions: a generic "constant expression" context and a "constant expression in signature" context?


Repository:
  rL LLVM

https://reviews.llvm.org/D28510





More information about the cfe-commits mailing list