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

Faisal Vali via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 14 19:37:42 PST 2017


faisalv updated this revision to Diff 84476.
faisalv added a comment.

The updated patch adds two additional enumerators to ExpressionEvaluationContext: ConstantEvaluatedInTemplateArgument and ConstantEvaluatedInFunctionSignature and sets them appropriately (as opposed to our previous approach of setting the IsLambdaExpressionForbidden flag in those locations).

When popping off the EvaluationContext, instead of checking the flag, we now check the EvaluationContext directly to determine if the Lambda Expression is valid.


Repository:
  rL LLVM

https://reviews.llvm.org/D28510

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Parse/Parser.h
  include/clang/Sema/Sema.h
  lib/Parse/ParseDecl.cpp
  lib/Parse/ParseExpr.cpp
  lib/Parse/ParseTemplate.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/SemaExprMember.cpp
  lib/Sema/SemaLambda.cpp
  lib/Sema/SemaTemplate.cpp
  lib/Sema/SemaTemplateInstantiateDecl.cpp
  lib/Sema/TreeTransform.h
  test/SemaCXX/cxx1z-constexpr-lambdas.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28510.84476.patch
Type: text/x-patch
Size: 15789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170115/7bce50cc/attachment.bin>


More information about the cfe-commits mailing list