llvm-project/clang/lib/Parse
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
..
CMakeLists.txt [CMake] Reorder libdeps by alphabetical order. 2014-07-14 04:59:27 +00:00
Makefile
ParseAST.cpp Restore PrettyStackTrace state on crash. 2015-08-07 17:48:57 +00:00
ParseCXXInlineMethods.cpp Merge some similar diagnostics using %select. 2015-11-14 18:16:08 +00:00
ParseDecl.cpp [modules] When a #include is mapped to a module import and appears somewhere 2015-11-17 23:32:01 +00:00
ParseDeclCXX.cpp [modules] When a #include is mapped to a module import and appears somewhere 2015-11-17 23:32:01 +00:00
ParseExpr.cpp [coroutines] Creation of promise object, lookup of operator co_await, building 2015-10-27 06:02:45 +00:00
ParseExprCXX.cpp Fix a layering oddity by passing Sema to DeclSpec::Finish instead of DiagnosticsEngine and Preprocessor. Everything the preprocessor was being used for can be acquired from Sema. 2015-11-15 03:32:11 +00:00
ParseInit.cpp Silence a -Wunused-variable warning; NFC. 2015-07-07 13:21:26 +00:00
ParseObjc.cpp Minor formatting fixes. NFC 2015-11-14 18:16:02 +00:00
ParseOpenMP.cpp [OPENMP 4.1] Add 'simd' clause for 'ordered' directive. 2015-09-28 06:39:35 +00:00
ParsePragma.cpp Put global classes into the appropriate namespace. 2015-10-28 13:54:16 +00:00
ParseStmt.cpp [modules] When a #include is mapped to a module import and appears somewhere 2015-11-17 23:32:01 +00:00
ParseStmtAsm.cpp Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC. 2015-09-15 16:17:27 +00:00
ParseTemplate.cpp [NFC] Change the evaluation context of a non-type default template argument from Unevaluated to ConstantEvaluated. 2015-11-18 04:29:22 +00:00
ParseTentative.cpp Add support for GCC's '__auto_type' extension, per the GCC manual: 2015-11-11 02:02:15 +00:00
Parser.cpp Merge some similar diagnostics using %select. 2015-11-14 18:16:08 +00:00
RAIIObjectsForParser.h Add a new error for unexpected semi-colon before closing delimiter. 2015-05-12 21:36:35 +00:00