[PATCH] D22997: [cxx1z-constexpr-lambda] Make conversion function constexpr, and teach the expression-evaluator to evaluate the static-invoker.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 4 06:59:22 PDT 2016


aaron.ballman added a comment.

Some small nits.


================
Comment at: lib/AST/ExprConstant.cpp:4409
@@ +4408,3 @@
+      } else if (MD && MD->isLambdaStaticInvoker()) {
+       
+        // Map the static invoker for the lambda back to the call operator.
----------------
Nit: remove new line.

================
Comment at: lib/AST/ExprConstant.cpp:4415
@@ +4414,3 @@
+        const CXXRecordDecl *ClosureClass = MD->getParent();
+         // number of captures better be zero.
+        assert(std::distance(ClosureClass->captures_begin(),
----------------
Nit: Capitalize Number.

================
Comment at: lib/AST/ExprConstant.cpp:4416-4417
@@ +4415,4 @@
+         // number of captures better be zero.
+        assert(std::distance(ClosureClass->captures_begin(),
+                             ClosureClass->captures_end()) == 0);
+        const CXXMethodDecl *LambdaCallOp = ClosureClass->getLambdaCallOperator();
----------------
Asserts should come with explanatory text &&'ed in.

================
Comment at: lib/AST/ExprConstant.cpp:4425
@@ +4424,3 @@
+        if (ClosureClass->isGenericLambda()) {
+          assert(MD->isFunctionTemplateSpecialization());
+          const TemplateArgumentList *TAL = MD->getTemplateSpecializationArgs();
----------------
Same here as above (and elsewhere).


Repository:
  rL LLVM

https://reviews.llvm.org/D22997





More information about the cfe-commits mailing list