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

2017-02-15 Thread Richard Smith via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D28510#654821, @faisalv wrote: > In https://reviews.llvm.org/D28510#653794, @rsmith wrote: > > > I don't think it's possible to check this in the way you're doing so here. > > In general, there's no way to know whether a constant expression wil

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

2017-01-26 Thread Faisal Vali via Phabricator via cfe-commits
faisalv updated this revision to Diff 85927. faisalv added a comment. I tried a different approach, not because I was convinced it was better, but because it seemed (at the time) a simpler tweak - I'm not sure it is robust enough - but would appreciate your thoughts on it. The approach is predi

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

2017-01-24 Thread Faisal Vali via Phabricator via cfe-commits
faisalv added a comment. In https://reviews.llvm.org/D28510#653794, @rsmith wrote: > I don't think it's possible to check this in the way you're doing so here. In > general, there's no way to know whether a constant expression will be part of > a `typedef` declaration or function declaration un

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

2017-01-23 Thread Richard Smith via Phabricator via cfe-commits
rsmith requested changes to this revision. rsmith added a comment. This revision now requires changes to proceed. I don't think it's possible to check this in the way you're doing so here. In general, there's no way to know whether a constant expression will be part of a `typedef` declaration or

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

2017-01-14 Thread Faisal Vali via Phabricator via cfe-commits
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 o

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

2017-01-10 Thread Faisal Vali via Phabricator via cfe-commits
faisalv added inline comments. Comment at: include/clang/Sema/Sema.h:894-895 +/// \brief Whether lambda expressions are forbidden here. +bool IsLambdaExprForbidden; + rsmith wrote: > Rather than adding a flag, how about we have two different kinds of >

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

2017-01-10 Thread Faisal Vali via Phabricator via cfe-commits
faisalv added a comment. Yes - I'll modify the patch to reflect that approach. Any thoughts on whether they should also be forbidden in Lamda parameter declaration clauses? Thanks! Repository: rL LLVM https://reviews.llvm.org/D28510 ___ cfe-com

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

2017-01-09 Thread Richard Smith via Phabricator via cfe-commits
rsmith added inline comments. Comment at: include/clang/Parse/Parser.h:1432 + ExprResult ParseConstantExpression(TypeCastState isTypeCast = NotTypeCast, + bool IsLambdaExprForbidden = false); ExprResult ParseConstraintExpression();

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

2017-01-09 Thread Faisal Vali via Phabricator via cfe-commits
faisalv created this revision. faisalv added a reviewer: rsmith. faisalv added a subscriber: cfe-commits. faisalv set the repository for this revision to rL LLVM. faisalv added a project: clang-c. This patch disables lambda expressions (especially Immediately Invoked Lambda Expressions (IILEs, to