llvm-project/clang/test/CXX
Faisal Vali 0374bf0d07 [NFC] Change the evaluation context of a non-type default template argument from Unevaluated to ConstantEvaluated.
This patch emits a more appropriate (but still noisy) diagnostic stream when a lambda-expression is encountered within a non-type default argument. 

For e.g. template<int N = ([] { return 5; }())> int f();

As opposed to complaining that a lambda expression is not allowed in an unevaluated operand, the patch complains about the lambda being forbidden in a constant expression context (which will be allowed in C++17 now that they have been accepted by EWG, unless of course CWG or national bodies (that have so far shown no signs of concern) rise in protest) 

As I start submitting patches for constexpr lambdas (http://wg21.link/P0170R0) under C++1z (OK'd by Richard Smith at Kona), this will be one less change to make.

Thanks!

llvm-svn: 253431
2015-11-18 04:29:22 +00:00
..
basic [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
class [Sema] Don't crash when friending an unqualified templated constructor 2015-09-30 22:07:43 +00:00
class.access [Lit Test] Updated 26 Lit tests to be C++11 compatible. 2015-11-11 19:34:47 +00:00
class.derived PR6037 2015-01-19 01:44:02 +00:00
concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept Add diagnostics which fall under [dcl.spec.concept]p5 2015-11-11 23:53:35 +00:00
conv PR6037 2015-01-19 01:44:02 +00:00
dcl.dcl [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
dcl.decl [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
drs DR407: Rationalize how we handle tags being hidden by typedefs. Even with 2015-11-12 22:04:34 +00:00
except Promote a warning on ill-formed code (redeclaration missing an exception 2015-09-30 00:48:50 +00:00
expr N3922: direct-list-initialization of an auto-typed variable no longer deduces a 2015-11-11 01:36:17 +00:00
lex When pretty-printing a C++11 literal operator, don't insert whitespace between 2015-10-08 00:17:59 +00:00
over When pretty-printing a C++11 literal operator, don't insert whitespace between 2015-10-08 00:17:59 +00:00
special Unify warnings/errors from "maybe you meant" to "did you mean". 2015-04-02 22:10:06 +00:00
stmt.stmt Sema: Allow 'constexpr' variables in range loops 2015-02-18 18:34:59 +00:00
temp [NFC] Change the evaluation context of a non-type default template argument from Unevaluated to ConstantEvaluated. 2015-11-18 04:29:22 +00:00