aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/misc.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-11-12 23:49:09 -0500
committerJason Merrill <jason@gcc.gnu.org>2018-11-12 23:49:09 -0500
commit0c1e0d63fe0ceabbd04384070f3b59f8bf50de09 (patch)
treeccbb8ff54004ee0dd964a8e4e5621030bf011aa9 /gcc/ada/gcc-interface/misc.c
parent7d119905abdf28f56486be0ca01a42f8efcea1a2 (diff)
downloadgcc-0c1e0d63fe0ceabbd04384070f3b59f8bf50de09.zip
gcc-0c1e0d63fe0ceabbd04384070f3b59f8bf50de09.tar.gz
gcc-0c1e0d63fe0ceabbd04384070f3b59f8bf50de09.tar.bz2
Implement P0315R4, Lambdas in unevaluated contexts.
When lambdas were added in C++11 they were banned from unevaluated contexts as a way to avoid needing to deal with them in mangling or SFINAE. This proposal avoids that with a more narrow proposal: lambdas never compare as equivalent (so we don't need to mangle them), and substitution failures within a lambda are hard errors. Lambdas appearing in places that types couldn't previously have been declared introduces various complications; in particular, it seems likely to mean types with no linkage being used more broadly, risking ODR violations. I want to follow up this patch with some related diagnostics. * decl2.c (min_vis_expr_r): Handle LAMBDA_EXPR. * mangle.c (write_expression): Handle LAMBDA_EXPR. * parser.c (cp_parser_lambda_expression): Allow lambdas in unevaluated context. Start the tentative firewall sooner. (cp_parser_lambda_body): Use cp_evaluated. * pt.c (iterative_hash_template_arg): Handle LAMBDA_EXPR. (tsubst_function_decl): Substitute a lambda even if it isn't dependent. (tsubst_lambda_expr): Use cp_evaluated. Always complain. (tsubst_copy_and_build) [LAMBDA_EXPR]: Do nothing if tf_partial. * semantics.c (begin_class_definition): Allow in template parm list. * tree.c (strip_typedefs_expr): Pass through LAMBDA_EXPR. (cp_tree_equal): Handle LAMBDA_EXPR. From-SVN: r266056
Diffstat (limited to 'gcc/ada/gcc-interface/misc.c')
0 files changed, 0 insertions, 0 deletions