[PATCH] D14905: [constexpr-lambda] Support parsing of constexpr specifier (and its inference) on lambda expressions

Faisal Vali via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 21 13:41:09 PST 2015


faisalv created this revision.
faisalv added reviewers: rsmith, doug.gregor, hubert.reinterpretcast, aaron.ballman, nwilson.
faisalv added a subscriber: cfe-commits.

This patch supports parsing of the constexpr specifier on lambdas - and its inference from the lambda call operator's body.

i.e. 
auto L = [] () constexpr { return 5; };
static_assert(L() == 5); // OK

It does not support evaluation of lambda's within constant expressions, which should follow this patch, when approved.





http://reviews.llvm.org/D14905

Files:
  include/clang/Basic/DiagnosticASTKinds.td
  include/clang/Basic/DiagnosticParseKinds.td
  include/clang/Sema/Sema.h
  lib/AST/ExprConstant.cpp
  lib/Parse/ParseExprCXX.cpp
  lib/Sema/SemaLambda.cpp
  lib/Sema/TreeTransform.h
  test/Parser/cxx1z-constexpr-lambdas.cpp
  test/SemaCXX/cxx1z-constexpr-lambdas.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14905.40873.patch
Type: text/x-patch
Size: 11912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151121/bf39bb6f/attachment.bin>


More information about the cfe-commits mailing list