]> granicus.if.org Git - clang/commitdiff
[cxx1z-constexpr-lambda] [NFC] Add a FIXME to reinstate certain restrictions on const...
authorFaisal Vali <faisalv@yahoo.com>
Mon, 9 Jan 2017 11:47:51 +0000 (11:47 +0000)
committerFaisal Vali <faisalv@yahoo.com>
Mon, 9 Jan 2017 11:47:51 +0000 (11:47 +0000)
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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291439 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index d5378b87e0cb450fe38db3cab7fc823306aa445a..d62e8fd68b6456f070402cd694a7361cbcaee365 100644 (file)
@@ -13118,7 +13118,13 @@ void Sema::PopExpressionEvaluationContext() {
         //   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);