r291439 - [cxx1z-constexpr-lambda] [NFC] Add a FIXME to reinstate certain restrictions on constexpr lambdas from appearing within function-signatures (CWG1607)

Faisal Vali via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 03:47:51 PST 2017


Author: faisalv
Date: Mon Jan  9 05:47:51 2017
New Revision: 291439

URL: http://llvm.org/viewvc/llvm-project?rev=291439&view=rev
Log:
[cxx1z-constexpr-lambda] [NFC] Add a FIXME to reinstate certain restrictions on constexpr lambdas from appearing within function-signatures (CWG1607)

For further background, see Richard's comments: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20170109/181998.html

A patch to fix this is being worked on.

Thanks!

Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=291439&r1=291438&r2=291439&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Jan  9 05:47:51 2017
@@ -13118,7 +13118,13 @@ void Sema::PopExpressionEvaluationContex
         //   evaluate [...] a lambda-expression.
         D = diag::err_lambda_in_constant_expression;
       }
+
       // C++1z allows lambda expressions as core constant expressions.
+      // FIXME: In C++1z, reinstate the restrictions on lambda expressions (CWG
+      // 1607) from appearing within template-arguments and array-bounds that
+      // are part of function-signatures.  Be mindful that P0315 (Lambdas in
+      // unevaluated contexts) might lift some of these restrictions in a 
+      // future version.
       if (Rec.Context != ConstantEvaluated || !getLangOpts().CPlusPlus1z)
         for (const auto *L : Rec.Lambdas)
           Diag(L->getLocStart(), D);




More information about the cfe-commits mailing list