aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
AgeCommit message (Collapse)AuthorFilesLines
2017-11-29re PR c++/82293 (ICE in nonlambda_method_basetype at gcc/cp/lambda.c:886)Paolo Carlini1-1/+1
/cp 2017-11-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/82293 * lambda.c (nonlambda_method_basetype): Don't use LAMBDA_TYPE_P on a null type. /testsuite 2017-11-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/82293 * g++.dg/cpp0x/lambda/lambda-ice24.C: New. From-SVN: r255254
2017-11-28Remove Cilk Plus support.Julia Koval1-1/+0
* Makefile.def (target_modules): Remove libcilkrts. * Makefile.in: Ditto. * configure: Ditto. * configure.ac: Ditto. contrib/ * contrib/gcc_update: Ditto. gcc/ * Makefile.in (cilkplus.def, cilk-builtins.def, c-family/cilk.o, c-family/c-cilkplus.o, c-family/array-notation-common.o, cilk-common.o, cilk.h, cilk-common.c): Remove. * builtin-types.def (BT_FN_INT_PTR_PTR_PTR_FTYPE_BT_INT_BT_PTR_BT_PTR_BT_PTR): Remove. * builtins.c (is_builtin_name): Remove cilkplus condition. (BUILT_IN_CILK_DETACH, BUILT_IN_CILK_POP_FRAME): Remove. * builtins.def (DEF_CILK_BUILTIN_STUB, DEF_CILKPLUS_BUILTIN, cilk-builtins.def, cilkplus.def): Remove. * cif-code.def (CILK_SPAWN): Remove. * cilk-builtins.def: Delete. * cilk-common.c: Ditto. * cilk.h: Ditto. * cilkplus.def: Ditto. * config/darwin.h (fcilkplus): Delete. * cppbuiltin.c: Ditto. * doc/extend.texi: Remove cilkplus doc. * doc/generic.texi: Ditto. * doc/invoke.texi: Ditto. * doc/passes.texi: Ditto. * gcc.c (fcilkplus): Remove. * gengtype.c (cilk.h): Remove. * gimple-pretty-print.c (dump_gimple_omp_for): Remove cilkplus support. * gimple.h (GF_OMP_FOR_KIND_CILKFOR, GF_OMP_FOR_KIND_CILKSIMD): Remove. * gimplify.c (gimplify_return_expr, maybe_fold_stmt, gimplify_call_expr, is_gimple_stmt, gimplify_modify_expr, gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses, gimplify_omp_for, gimplify_expr): Remove cilkplus conditions. * ipa-fnsummary.c (ipa_dump_fn_summary, compute_fn_summary, inline_read_section): Ditto. * ipa-inline-analysis.c (cilk.h): Remove. * ira.c (ira_setup_eliminable_regset): Remove cilkplus support. * lto-wrapper.c (merge_and_complain, append_compiler_options, append_linker_options): Remove condition for fcilkplus. * lto/lto-lang.c (cilk.h): Remove. (lto_init): Remove condition for fcilkplus. * omp-expand.c (expand_cilk_for_call): Delete. (expand_omp_taskreg, expand_omp_for_static_chunk, expand_omp_for): Remove cilkplus conditions. (expand_cilk_for): Delete. * omp-general.c (omp_extract_for_data): Remove cilkplus support. * omp-low.c (scan_sharing_clauses, create_omp_child_function, execute_lower_omp, diagnose_sb_0): Ditto. * omp-simd-clone.c (simd_clone_clauses_extract): Ditto. * tree-core.h (OMP_CLAUSE__CILK_FOR_COUNT_): Delete. * tree-nested.c: Ditto. * tree-pretty-print.c (dump_omp_clause): Remove cilkplus support. (dump_generic_node): Ditto. * tree.c (OMP_CLAUSE__CILK_FOR_COUNT_): Delete. * tree.def (cilk_simd, cilk_for, cilk_spawn_stmt, cilk_sync_stmt): Delete. * tree.h (CILK_SPAWN_FN, EXPR_CILK_SPAWN): Delete. gcc/c-family/ * array-notation-common.c: Delete. * c-cilkplus.c: Ditto. * c-common.c (_Cilk_spawn, _Cilk_sync, _Cilk_for): Remove. * c-common.def (ARRAY_NOTATION_REF): Remove. * c-common.h (RID_CILK_SPAWN, build_array_notation_expr, build_array_notation_ref, C_ORT_CILK, c_check_cilk_loop, c_validate_cilk_plus_loop, cilkplus_an_parts, cilk_ignorable_spawn_rhs_op, cilk_recognize_spawn): Remove. * c-gimplify.c (CILK_SPAWN_STMT): Remove. * c-omp.c: Remove CILK_SIMD check. * c-pragma.c: Ditto. * c-pragma.h: Remove CILK related pragmas. * c-pretty-print.c (c_pretty_printer::postfix_expression): Remove ARRAY_NOTATION_REF condition. (c_pretty_printer::expression): Ditto. * c.opt (fcilkplus): Remove. * cilk.c: Delete. gcc/c/ * Make-lang.in (c/c-array-notation.o): Remove. * c-array-notation.c: Delete. * c-decl.c: Remove cilkplus condition. * c-parser.c (c_parser_cilk_simd, c_parser_cilk_for, c_parser_cilk_verify_simd, c_parser_array_notation, c_parser_cilk_clause_vectorlength, c_parser_cilk_grainsize, c_parser_cilk_simd_fn_vector_attrs, c_finish_cilk_simd_fn_tokens): Delete. (c_parser_declaration_or_fndef): Remove cilkplus condition. (c_parser_direct_declarator_inner): Ditto. (CILK_SIMD_FN_CLAUSE_MASK): Delete. (c_parser_attributes, c_parser_compound_statement, c_parser_statement_after_labels, c_parser_if_statement, c_parser_switch_statement, c_parser_while_statement, c_parser_do_statement, c_parser_for_statement, c_parser_unary_expression, c_parser_postfix_expression, c_parser_postfix_expression_after_primary, c_parser_pragma, c_parser_omp_clause_name, c_parser_omp_all_clauses, c_parser_omp_for_loop, c_finish_omp_declare_simd): Remove cilkplus support. * c-typeck.c (build_array_ref, build_function_call_vec, convert_arguments, lvalue_p, build_compound_expr, c_finish_return, c_finish_if_stmt, c_finish_loop, build_binary_op): Remove cilkplus support. gcc/cp/ * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete. * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus. * constexpr.c (potential_constant_expression_1): Ditto. * cp-array-notation.c: Delete. * cp-cilkplus.c: Ditto. * cp-cilkplus.h: Ditto. * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove cilkplus condition. * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete. * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete. * decl.c (grokfndecl, finish_function): Remove cilkplus condition. * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition. * lambda.c (cp-cilkplus.h): Remove. * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for, cp_parser_cilk_simd_vectorlength): Delete. (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body, cp_parser_postfix_expression, cp_parser_postfix_open_square_expression, cp_parser_statement, cp_parser_jump_statement, cp_parser_direct_declarator, cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list, cp_parser_omp_clause_name, cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear, cp_parser_omp_all_clauses, cp_parser_omp_flush, cp_parser_omp_for_cond, cp_parser_omp_for_incr, cp_parser_omp_for_loop_init, cp_parser_omp_for_loop, cp_parser_omp_declare_simd): Remove cilkplus support. (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info, cp_parser_cilk_grainsize): Remove. (cp_parser_pragma, c_parse_file): Remove cilkplus support. (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear, cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses, cp_parser_cilk_simd, cp_parser_cilk_for): Remove. * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove. * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove cilkplus support. * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body, finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr, finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove cilkplus support. * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon. * typeck.c (cp_build_array_ref, cp_build_compound_expr, check_return_expr): Remove cilkplus support. gcc/testsuite/ * c-c++-common/attr-simd-3.c: Delete. * c-c++-common/cilk-plus/AN/an-if.c: Delete. * c-c++-common/cilk-plus/AN/array_test1.c: Delete. * c-c++-common/cilk-plus/AN/array_test2.c: Delete. * c-c++-common/cilk-plus/AN/array_test_ND.c: Delete. * c-c++-common/cilk-plus/AN/builtin_fn_custom.c: Delete. * c-c++-common/cilk-plus/AN/builtin_fn_mutating.c: Delete. * c-c++-common/cilk-plus/AN/builtin_func_double.c: Delete. * c-c++-common/cilk-plus/AN/builtin_func_double2.c: Delete. * c-c++-common/cilk-plus/AN/comma_exp.c: Delete. * c-c++-common/cilk-plus/AN/conditional.c: Delete. * c-c++-common/cilk-plus/AN/decl-ptr-colon.c: Delete. * c-c++-common/cilk-plus/AN/dimensionless-arrays.c: Delete. * c-c++-common/cilk-plus/AN/exec-once.c: Delete. * c-c++-common/cilk-plus/AN/exec-once2.c: Delete. * c-c++-common/cilk-plus/AN/fn_ptr-2.c: Delete. * c-c++-common/cilk-plus/AN/fn_ptr.c: Delete. * c-c++-common/cilk-plus/AN/fp_triplet_values.c: Delete. * c-c++-common/cilk-plus/AN/gather-scatter-errors.c: Delete. * c-c++-common/cilk-plus/AN/gather_scatter.c: Delete. * c-c++-common/cilk-plus/AN/if_test.c: Delete. * c-c++-common/cilk-plus/AN/if_test_errors.c: Delete. * c-c++-common/cilk-plus/AN/misc.c: Delete. * c-c++-common/cilk-plus/AN/n-ptr-test.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors2.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors3.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors4.c: Delete. * c-c++-common/cilk-plus/AN/pr57457-2.c: Delete. * c-c++-common/cilk-plus/AN/pr57457.c: Delete. * c-c++-common/cilk-plus/AN/pr57490.c: Delete. * c-c++-common/cilk-plus/AN/pr57541-2.c: Delete. * c-c++-common/cilk-plus/AN/pr57541.c: Delete. * c-c++-common/cilk-plus/AN/pr57577.c: Delete. * c-c++-common/cilk-plus/AN/pr58942.c: Delete. * c-c++-common/cilk-plus/AN/pr61191.c: Delete. * c-c++-common/cilk-plus/AN/pr61455-2.c: Delete. * c-c++-common/cilk-plus/AN/pr61455.c: Delete. * c-c++-common/cilk-plus/AN/pr61962.c: Delete. * c-c++-common/cilk-plus/AN/pr61963.c: Delete. * c-c++-common/cilk-plus/AN/pr62008.c: Delete. * c-c++-common/cilk-plus/AN/pr63884.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch2.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch3.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit2.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit_ex.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_return.c: Delete. * c-c++-common/cilk-plus/AN/side-effects-1.c: Delete. * c-c++-common/cilk-plus/AN/test_builtin_return.c: Delete. * c-c++-common/cilk-plus/AN/test_sec_limits.c: Delete. * c-c++-common/cilk-plus/AN/tst_lngth.c: Delete. * c-c++-common/cilk-plus/AN/vla.c: Delete. * c-c++-common/cilk-plus/CK/Wparentheses-1.c: Delete. * c-c++-common/cilk-plus/CK/cilk-for-2.c: Delete. * c-c++-common/cilk-plus/CK/cilk-for-3.c: Delete. * c-c++-common/cilk-plus/CK/cilk-fors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_errors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_grain.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c: Delete. * c-c++-common/cilk-plus/CK/compound_cilk_spawn.c: Delete. * c-c++-common/cilk-plus/CK/concec_cilk_spawn.c: Delete. * c-c++-common/cilk-plus/CK/errors.c: Delete. * c-c++-common/cilk-plus/CK/fib.c: Delete. * c-c++-common/cilk-plus/CK/fib_init_expr_xy.c: Delete. * c-c++-common/cilk-plus/CK/fib_no_return.c: Delete. * c-c++-common/cilk-plus/CK/fib_no_sync.c: Delete. * c-c++-common/cilk-plus/CK/invalid_spawns.c: Delete. * c-c++-common/cilk-plus/CK/invalid_sync.c: Delete.c * c-c++-common/cilk-plus/CK/nested_cilk_for.c: Delete. * c-c++-common/cilk-plus/CK/no_args_error.c: Delete. * c-c++-common/cilk-plus/CK/pr59631.c: Delete. * c-c++-common/cilk-plus/CK/pr60197-2.c: Delete. * c-c++-common/cilk-plus/CK/pr60197.c: Delete. * c-c++-common/cilk-plus/CK/pr60469.c: Delete. * c-c++-common/cilk-plus/CK/pr60586.c: Delete. * c-c++-common/cilk-plus/CK/pr63307.c: Delete. * c-c++-common/cilk-plus/CK/pr69826-1.c: Delete. * c-c++-common/cilk-plus/CK/pr69826-2.c: Delete. * c-c++-common/cilk-plus/CK/pr79428-4.c: Delete. * c-c++-common/cilk-plus/CK/pr79428-7.c: Delete. * c-c++-common/cilk-plus/CK/spawn_in_return.c: Delete. * c-c++-common/cilk-plus/CK/spawnee_inline.c: Delete. * c-c++-common/cilk-plus/CK/spawner_inline.c: Delete. * c-c++-common/cilk-plus/CK/spawning_arg.c: Delete. * c-c++-common/cilk-plus/CK/steal_check.c: Delete. * c-c++-common/cilk-plus/CK/sync_wo_spawn.c: Delete. * c-c++-common/cilk-plus/CK/test__cilk.c: Delete. * c-c++-common/cilk-plus/CK/varargs_test.c: Delete. * c-c++-common/cilk-plus/PS/Wparentheses-1.c: Delete. * c-c++-common/cilk-plus/PS/body.c: Delete. * c-c++-common/cilk-plus/PS/clauses1.c: Delete. * c-c++-common/cilk-plus/PS/clauses2.c: Delete. * c-c++-common/cilk-plus/PS/clauses3.c: Delete. * c-c++-common/cilk-plus/PS/clauses4.c: Delete. * c-c++-common/cilk-plus/PS/for1.c: Delete. * c-c++-common/cilk-plus/PS/for2.c: Delete. * c-c++-common/cilk-plus/PS/for3.c: Delete. * c-c++-common/cilk-plus/PS/pr69363.c: Delete. * c-c++-common/cilk-plus/PS/reduction-1.c: Delete. * c-c++-common/cilk-plus/PS/reduction-2.c: Delete. * c-c++-common/cilk-plus/PS/reduction-3.c: Delete. * c-c++-common/cilk-plus/PS/run-1.c: Delete. * c-c++-common/cilk-plus/PS/safelen.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength-2.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength-3.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength.c: Delete. * c-c++-common/cilk-plus/SE/ef_error.c: Delete. * c-c++-common/cilk-plus/SE/ef_error2.c: Delete. * c-c++-common/cilk-plus/SE/ef_error3.c: Delete. * c-c++-common/cilk-plus/SE/ef_test.c: Delete. * c-c++-common/cilk-plus/SE/ef_test2.c: Delete. * c-c++-common/cilk-plus/SE/vlength_errors.c: Delete. * g++.dg/cilk-plus/AN/array_function.c: Delete. * g++.dg/cilk-plus/AN/array_test1_tplt.c: Delete. * g++.dg/cilk-plus/AN/array_test2_tplt.c: Delete. * g++.dg/cilk-plus/AN/array_test_ND_tplt.c: Delete. * g++.dg/cilk-plus/AN/braced_list.c: Delete. * g++.dg/cilk-plus/AN/builtin_fn_custom_tplt.c: Delete. * g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.c: Delete. * g++.dg/cilk-plus/AN/fp_triplet_values_tplt.c: Delete. * g++.dg/cilk-plus/AN/postincr_test.c: Delete. * g++.dg/cilk-plus/AN/preincr_test.c: Delete. * g++.dg/cilk-plus/CK/catch_exc.c: Delete. * g++.dg/cilk-plus/CK/cf3.c: Delete. * g++.dg/cilk-plus/CK/cilk-for-tplt.c: Delete. * g++.dg/cilk-plus/CK/const_spawn.c: Delete. * g++.dg/cilk-plus/CK/fib-opr-overload.c: Delete. * g++.dg/cilk-plus/CK/fib-tplt.c: Delete. * g++.dg/cilk-plus/CK/for1.c: Delete. * g++.dg/cilk-plus/CK/lambda_spawns.c: Delete. * g++.dg/cilk-plus/CK/lambda_spawns_tplt.c: Delete. * g++.dg/cilk-plus/CK/pr60586.c: Delete. * g++.dg/cilk-plus/CK/pr66326.c: Delete. * g++.dg/cilk-plus/CK/pr68001.c: Delete. * g++.dg/cilk-plus/CK/pr68997.c: Delete. * g++.dg/cilk-plus/CK/pr69024.c: Delete. * g++.dg/cilk-plus/CK/pr69048.c: Delete. * g++.dg/cilk-plus/CK/pr69267.c: Delete. * g++.dg/cilk-plus/CK/pr80038.c: Delete. * g++.dg/cilk-plus/CK/stl_iter.c: Delete. * g++.dg/cilk-plus/CK/stl_rev_iter.c: Delete. * g++.dg/cilk-plus/CK/stl_test.c: Delete. * g++.dg/cilk-plus/cilk-plus.exp * g++.dg/cilk-plus/ef_test.C: Delete. * g++.dg/cilk-plus/for.C: Delete. * g++.dg/cilk-plus/for2.C: Delete. * g++.dg/cilk-plus/for3.C: Delete. * g++.dg/cilk-plus/for4.C: Delete. * g++.dg/cilk-plus/pr60967.C: Delete. * g++.dg/cilk-plus/pr69028.C: Delete. * g++.dg/cilk-plus/pr70565.C: Delete. * g++.dg/pr57662.C: Delete. * gcc.dg/cilk-plus/cilk-plus.exp * gcc.dg/cilk-plus/for1.c: Delete. * gcc.dg/cilk-plus/for2.c: Delete. * gcc.dg/cilk-plus/jump-openmp.c: Delete. * gcc.dg/cilk-plus/jump.c: Delete. * gcc.dg/cilk-plus/pr69798-1.c: Delete. * gcc.dg/cilk-plus/pr69798-2.c: Delete. * gcc.dg/cilk-plus/pr78306.c: Delete. * gcc.dg/cilk-plus/pr79116.c: Delete. * gcc.dg/graphite/id-28.c: Delete. * lib/cilk-plus-dg.exp: Delete. * lib/target-supports.exp (cilkplus_runtime): Delete. Co-Authored-By: Sebastian Peryt <sebastian.peryt@intel.com> From-SVN: r255195
2017-11-20[PR c++/82878] pass-by-invisiref in lambdaNathan Sidwell1-1/+0
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01115.html PR c++/82878 PR c++/78495 * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited ctor. * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference inhibibition check removed in previous c++/78495 change. PR c++/82878 * g++.dg/cpp0x/pr82878.C: New. * g++.dg/cpp1z/inh-ctor38.C: Check moves too. From-SVN: r254958
2017-11-15[PR c++/81574] lambda capture of function referenceNathan Sidwell1-1/+2
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01200.html PR c++/81574 * lambda.c (lambda_capture_field_type): Function references are always catured by reference. PR c++/81574 * g++.dg/cpp1y/pr81574.C: New. From-SVN: r254768
2017-11-13Capture adjustments for P0588R1.Jason Merrill1-115/+0
* semantics.c (process_outer_var_ref): Capture variables when they are named; complain about non-capture uses when odr-used. * expr.c (mark_use): Rvalue use looks through capture proxy. * constexpr.c (potential_constant_expression_1): Improve error about use of captured variable. * lambda.c (need_generic_capture, dependent_capture_r) (do_dependent_capture, processing_nonlambda_template): Remove. * call.c (build_this): Remove uses of the above. * decl.c (cp_finish_decl): Likewise. * semantics.c (maybe_cleanup_point_expr) (maybe_cleanup_point_expr_void, finish_goto_stmt) (maybe_convert_cond): Likewise. * typeck.c (check_return_expr): Likewise. From-SVN: r254713
2017-11-13Defer folding of *&.Jason Merrill1-6/+3
* typeck.c (cp_build_fold_indirect_ref): New. (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref. Add 'fold' parameter. * cp-tree.h: Declare cp_build_fold_indirect_ref. * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c, parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it. * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR. (cp_convert_range_for): Likewise. * typeck2.c (build_x_arrow): Use RO_ARROW. From-SVN: r254712
2017-10-31[C++ PATCH] overloaded operator fns [1/N]Nathan Sidwell1-7/+4
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg02315.html * cp-tree.h (assign_op_identifier, call_op_identifier): Define. (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS. (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false. (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define. * call.c (add_function_candidate): Use DECL_OVERLOADED_OPERATOR_IS. (build_op_call_1): Use call_op_identifier & DECL_OVERLOADED_OPERATOR_IS. (build_over_call): Likewise. (has_trivial_copy_assign_p): Use assign_op_identifier. (build_special_member_call): Likewise. * class.c (dfs_declare_virt_assop_and_dtor): Likewise. (vbase_has_user_provided_move_assign, classtype_has_move_assign_or_move_ctor_p): Likewise. * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE. (grok_special_member_properties): Use assign_op_identifier. (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS. * decl2.c (mark_used): Use DECL_CONV_FN_P. * dump.c (dump_access): Delete prototype. (dump_op): Delete. (cp_dump_tree): Don't call it. * lambda.c (lambda_function): Use call_op_identifier. (maybe_add_lambda_conv_op): Not an overloaded operator. Remove unneeded braces. * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE. * method.c (do_build_copy_assign): Use assign_op_identifier. (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS. (get_copy_assign): Use assign_op_identifier. (synthesized_method_walk): Likewise. (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS. * parser.c (cp_parser_lambda_declarator_opt): Use call_op_identifier. * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use assign_op_identifier. * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS. * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE. (check_return_expr): Use assign_op_identifier. From-SVN: r254263
2017-10-10More delayed lambda capture fixes.Jason Merrill1-1/+129
* call.c (add_function_candidate): Use build_address. (build_op_call_1): Call mark_lvalue_use early. (build_over_call): Handle error from build_this. * constexpr.c (cxx_bind_parameters_in_call): Use build_address. (cxx_eval_increment_expression): Don't use rvalue(). * cvt.c (convert_to_void): Use mark_discarded_use. * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix reference handling. Don't copy the expression. (mark_discarded_use): New. * lambda.c (insert_capture_proxy): Add some sanity checking. (maybe_add_lambda_conv_op): Set cp_unevaluated_operand. * pt.c (register_local_specialization): Add sanity check. * semantics.c (process_outer_var_ref): Fix check for existing proxy. * typeck.c (cp_build_addr_expr_1): Handle error from mark_lvalue_use. (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error from rvalue. Handle generic lambda capture in dependent expressions. * lambda.c (need_generic_capture, dependent_capture_r) (do_dependent_capture): New. * pt.c (processing_nonlambda_template): Use need_generic_capture. * semantics.c (maybe_cleanup_point_expr) (maybe_cleanup_point_expr_void, finish_goto_stmt) (maybe_convert_cond): Call do_dependent_capture. * typeck.c (build_static_cast): Remove dependent capture handling. From-SVN: r253601
2017-10-06re PR c++/47791 (finish function is using literal value instead of a ↵Paolo Carlini1-3/+3
#defined one) 2017-10-06 Paolo Carlini <paolo.carlini@oracle> PR c++/47791 * decl.c (finish_function): Take a bool intead of an int; adjust. * cp-tree.h (finish_function): Adjust declaration. * decl2.c (generate_tls_wrapper, finish_objects, finish_static_storage_duration_function): Adjust calls. * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function): Likewise. * method.c (synthesize_method): Likewise. * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise. * pt.c (instantiate_decl): Likewise. * parser.c (cp_parser_function_definition_after_declarator, cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction): Likewise. (cp_parser_ctor_initializer_opt, cp_parser_ctor_initializer_opt_and_function_body, cp_parser_function_try_block, cp_parser_function_definition_after_declarator, cp_parser_function_transaction): Return void; adjust declarations. From-SVN: r253497
2017-09-28Use local_specializations to find capture proxies.Jason Merrill1-5/+31
* cp-tree.h (DECL_CAPTURED_VARIABLE): New. * lambda.c (build_capture_proxy): Set it. (add_capture): Pass initializer to build_capture_proxy. (start_lambda_function): Likewise. (insert_capture_proxy): Use register_local_specialization. (is_lambda_ignored_entity): Always ignore proxies. * name-lookup.c (qualify_lookup): Don't check is_lambda_ignored_entity if LOOKUP_HIDDEN is set. * semantics.c (process_outer_var_ref): Use retrieve_local_specialization. * parser.c (cp_parser_lambda_body): Push local_specializations. * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy. (tsubst_lambda_expr): Push local_specializations sooner. (tsubst_copy_and_build): Don't register_local_specialization. From-SVN: r253265
2017-09-28Small lambda fixes.Jason Merrill1-1/+4
* call.c (build_special_member_call): Use the return value of mark_lvalue_use. * decl.c (compute_array_index_type): Likewise. * parser.c (cp_parser_oacc_wait_list): Likewise. * lambda.c (is_normal_capture_proxy): Handle *this capture. (add_capture): Clarify internal_error message. From-SVN: r253264
2017-09-15invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and ↵Jakub Jelinek1-1/+1
gnu++1z as deprecated. * doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and gnu++1z as deprecated. Change other references to -std=c++1z to -std=c++17 and -std=gnu++1z to -std=gnu++17. Change -Wc++1z-compat to -Wc++17-compat. * doc/cpp.texi: Document -std=c++17 defines __cplusplus 201703L. * dwarf2out.c (highest_c_language): Handle C++17. (gen_compile_unit_die): Likewise. c-family/ * c.opt (Wc++1z-compat): Change from option to undocumented alias. (Wc++17-compat): Change from undocumented alias to option. (Wnoexcept-type): Enable by Wc++17-compat instead of Wc++1z-compat, change C++1z to C++17 in description. (std=c++1z, std=gnu++1z): Change from option to undocumented deprecated alias. (std=c++17, std=gnu++17): Change from undocumented alias to option. Adjust description. * c-common.h (enum cxx_dialect): Rename cxx1z to cxx17. * c-opts.c (set_std_cxx1z): Rename to ... (set_std_cxx17): ... this. (c_common_handle_option): Rename OPT_std_c__1z to OPT_std_c__17 and OPT_std_gnu__1z to OPT_std_gnu__17. Adjust set_std_cxx1z caller. (c_common_post_options): Use cxx17 instead of cxx1z. Adjust comments. cp/ * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z, adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z to C++17 or -std=gnu++17 or -std=c++17. Adjust comments. (cxx_init_decl_processing, next_initializable_field, is_direct_enum_init, check_initializer, cp_finish_decl, mark_inline_variable, grokdeclarator, grokparms, xref_basetypes, finish_function): Likewise. * cp-tree.h (DECL_INLINE_VAR_P): Likewise. * pt.c (mark_template_parm, convert_nontype_argument, instantiate_class_template_1, type_unification_real, unify, get_partial_spec_bindings, dependent_type_p_r): Likewise. * typeck.c (cp_build_unary_op): Likewise. * constexpr.c (var_in_maybe_constexpr_fn): Likewise. * call.c (build_user_type_conversion_1, build_over_call, build_special_member_call): Likewise. * lambda.c (begin_lambda_type): Likewise. * typeck2.c (process_init_constructor_record): Likewise. * class.c (build_base_field, finalize_literal_type_property, explain_non_literal_class): Likewise. * parser.c (cp_parser_diagnose_invalid_type_name, cp_parser_primary_expression, cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt, cp_parser_selection_statement, cp_convert_range_for, cp_parser_perform_range_for_lookup, cp_parser_decomposition_declaration, cp_parser_linkage_specification, cp_parser_static_assert, cp_parser_simple_type_specifier, cp_parser_namespace_definition, cp_parser_using_declaration, cp_parser_init_declarator, cp_parser_type_parameter_key, cp_parser_exception_specification_opt, cp_parser_std_attribute_spec, cp_parser_constructor_declarator_p): Likewise. * mangle.c (struct globals): Rename need_cxx1z_warning to need_cxx17_warning. (write_exception_spec, start_mangling, mangle_decl): Likewise. * Make-lang.in (check-c++1z): Rename to check-c++17, depend on it. (check-c++17): New goal. Use 17 instead of 1z. (check-c++-all): Use 17 instead of 1z. testsuite/ * lib/g++-dg.exp (g++-dg-runtest): Use 17 instead of 1z. * lib/target-supports.exp (check_effective_target_c++14): Use check_effective_target_c++17 instead of check_effective_target_c++1z. (check_effective_target_c++14_down): Likewise. (check_effective_target_c++1z_only): Rename to ... (check_effective_target_c++17_only): ... this. (check_effective_target_c++1z): Rename to ... (check_effective_target_c++17): ... this. * g++.dg/debug/dwarf2/inline-var-1.C: Use -std=c++17 or -std=gnu++17 instead of -std=c++1z or -std=gnu++1z. Use c++17 instead of c++1z and c++17_only instead of c++1z_only. Adjust expected diagnostics and comments refering to 1z to 17. * g++.dg/debug/dwarf2/inline-var-2.C: Likewise. * g++.dg/template/partial5.C: Likewise. * g++.dg/template/nontype8.C: Likewise. * g++.dg/cpp1z/noexcept-type5.C: Likewise. * g++.dg/cpp1z/nontype3a.C: Likewise. * g++.dg/cpp1z/constexpr-lambda4.C: Likewise. * g++.dg/cpp1z/noexcept-type16.C: Likewise. * g++.dg/cpp1z/class-deduction32.C: Likewise. * g++.dg/cpp1z/pr78771.C: Likewise. * g++.dg/cpp1z/elide1.C: Likewise. * g++.dg/cpp1z/fold3.C: Likewise. * g++.dg/cpp1z/class-deduction2.C: Likewise. * g++.dg/cpp1z/noexcept-type12.C: Likewise. * g++.dg/cpp1z/inline-var2.C: Likewise. * g++.dg/cpp1z/eval-order2.C: Likewise. * g++.dg/cpp1z/decomp21.C: Likewise. * g++.dg/cpp1z/constexpr-lambda11.C: Likewise. * g++.dg/cpp1z/constexpr-lambda9.C: Likewise. * g++.dg/cpp1z/utf8-neg.C: Likewise. * g++.dg/cpp1z/class-deduction41.C: Likewise. * g++.dg/cpp1z/class-deduction23.C: Likewise. * g++.dg/cpp1z/nodiscard3.C: Likewise. * g++.dg/cpp1z/static_assert-nomsg.C: Likewise. * g++.dg/cpp1z/noexcept-type9.C: Likewise. * g++.dg/cpp1z/class-deduction21.C: Likewise. * g++.dg/cpp1z/range-for1.C: Likewise. * g++.dg/cpp1z/init-statement4.C: Likewise. * g++.dg/cpp1z/udlit-utf8char.C: Likewise. * g++.dg/cpp1z/decomp30.C: Likewise. * g++.dg/cpp1z/class-deduction39.C: Likewise. * g++.dg/cpp1z/register2.C: Likewise. * g++.dg/cpp1z/decomp9.C: Likewise. * g++.dg/cpp1z/regress1.C: Likewise. * g++.dg/cpp1z/direct-enum-init1.C: Likewise. * g++.dg/cpp1z/class-deduction30.C: Likewise. * g++.dg/cpp1z/abbrev2.C: Likewise. * g++.dg/cpp1z/nontype-auto6.C: Likewise. * g++.dg/cpp1z/regress2.C: Likewise. * g++.dg/cpp1z/decomp16.C: Likewise. * g++.dg/cpp1z/bool-increment1.C: Likewise. * g++.dg/cpp1z/aligned-new1.C: Likewise. * g++.dg/cpp1z/decomp3.C: Likewise. * g++.dg/cpp1z/register1.C: Likewise. * g++.dg/cpp1z/namespace-attribs.C: Likewise. * g++.dg/cpp1z/class-deduction1.C: Likewise. * g++.dg/cpp1z/decomp10.C: Likewise. * g++.dg/cpp1z/constexpr-if11.C: Likewise. * g++.dg/cpp1z/constexpr-lambda10.C: Likewise. * g++.dg/cpp1z/decomp27.C: Likewise. * g++.dg/cpp1z/noexcept-type2.C: Likewise. * g++.dg/cpp1z/constexpr-lambda6.C: Likewise. * g++.dg/cpp1z/class-deduction9.C: Likewise. * g++.dg/cpp1z/attributes-enum-1.C: Likewise. * g++.dg/cpp1z/decomp11.C: Likewise. * g++.dg/cpp1z/aligned-new3.C: Likewise. * g++.dg/cpp1z/utf8-2.C: Likewise. * g++.dg/cpp1z/lambda-this3.C: Likewise. * g++.dg/cpp1z/decomp-constexpr1.C: Likewise. * g++.dg/cpp1z/byte1.C: Likewise. * g++.dg/cpp1z/nontype-auto9.C: Likewise. * g++.dg/cpp1z/aggr-base4.C: Likewise. * g++.dg/cpp1z/constexpr-lambda1.C: Likewise. * g++.dg/cpp1z/nontype-auto3.C: Likewise. * g++.dg/cpp1z/utf8-2a.C: Likewise. * g++.dg/cpp1z/constexpr-lambda7.C: Likewise. * g++.dg/cpp1z/aggr-base6.C: Likewise. * g++.dg/cpp1z/cplusplus.C: Likewise. * g++.dg/cpp1z/class-deduction20.C: Likewise. * g++.dg/cpp1z/aggr-base2.C: Likewise. * g++.dg/cpp1z/class-deduction6.C: Likewise. * g++.dg/cpp1z/noexcept-type3.C: Likewise. * g++.dg/cpp1z/class-deduction31.C: Likewise. * g++.dg/cpp1z/class-deduction25.C: Likewise. * g++.dg/cpp1z/class-deduction18.C: Likewise. * g++.dg/cpp1z/fold9.C: Likewise. * g++.dg/cpp1z/noexcept-type8.C: Likewise. * g++.dg/cpp1z/abbrev1.C: Likewise. * g++.dg/cpp1z/constexpr-if10.C: Likewise. * g++.dg/cpp1z/utf8.C: Likewise. * g++.dg/cpp1z/noexcept-type7.C: Likewise. * g++.dg/cpp1z/aggr-base3.C: Likewise. * g++.dg/cpp1z/constexpr-lambda8.C: Likewise. * g++.dg/cpp1z/init-statement2.C: Likewise. * g++.dg/cpp1z/nontype-auto4.C: Likewise. * g++.dg/cpp1z/constexpr-if12.C: Likewise. * g++.dg/cpp1z/class-deduction40.C: Likewise. * g++.dg/cpp1z/nontype3.C: Likewise. * g++.dg/cpp1z/class-deduction14.C: Likewise. * g++.dg/cpp1z/fold7.C: Likewise. * g++.dg/cpp1z/nontype2.C: Likewise. * g++.dg/cpp1z/class-deduction15.C: Likewise. * g++.dg/cpp1z/nested-namespace-def1.C: Likewise. * g++.dg/cpp1z/class-deduction13.C: Likewise. * g++.dg/cpp1z/aligned-new7.C: Likewise. * g++.dg/cpp1z/noexcept-type1.C: Likewise. * g++.dg/cpp1z/nontype1.C: Likewise. * g++.dg/cpp1z/init-statement5.C: Likewise. * g++.dg/cpp1z/nontype-auto2.C: Likewise. * g++.dg/cpp1z/decomp17.C: Likewise. * g++.dg/cpp1z/fold4.C: Likewise. * g++.dg/cpp1z/constexpr-lambda2.C: Likewise. * g++.dg/cpp1z/fold7a.C: Likewise. * g++.dg/cpp1z/nontype-auto5.C: Likewise. * g++.dg/cpp1z/init-statement7.C: Likewise. * g++.dg/cpp1z/aggr-base5.C: Likewise. * g++.dg/cpp1z/constexpr-lambda5.C: Likewise. * g++.dg/cpp1z/pr79143.C: Likewise. * g++.dg/cpp1z/class-deduction38.C: Likewise. * g++.dg/cpp1z/nontype-auto8.C: Likewise. * g++.dg/cpp1z/class-deduction12.C: Likewise. * g++.dg/cpp1z/decomp20.C: Likewise. * g++.dg/cpp1z/class-deduction22.C: Likewise. * g++.dg/cpp1z/class-deduction29.C: Likewise. * g++.dg/cpp1z/class-deduction8.C: Likewise. * g++.dg/cpp1z/class-deduction43.C: Likewise. * g++.dg/cpp1z/feat-cxx1z.C: Likewise. * g++.dg/cpp1z/fold8.C: Likewise. * g++.dg/cpp1z/init-statement3.C: Likewise. * g++.dg/cpp1z/nontype-auto10.C: Likewise. * g++.dg/cpp1z/class-deduction36.C: Likewise. * g++.dg/cpp1z/noexcept-type17.C: Likewise. * g++.dg/cpp1z/fallthrough1.C: Likewise. * g++.dg/cpp1z/fold1.C: Likewise. * g++.dg/cpp1z/class-deduction26.C: Likewise. * g++.dg/cpp1z/fold-ice1.C: Likewise. * g++.dg/cpp1z/fold5.C: Likewise. * g++.dg/cpp1z/class-deduction34.C: Likewise. * g++.dg/cpp1z/noexcept-type6.C: Likewise. * g++.dg/cpp1z/class-deduction7.C: Likewise. * g++.dg/cpp1z/class-deduction16.C: Likewise. * g++.dg/cpp1z/class-deduction10.C: Likewise. * g++.dg/cpp1z/eval-order3.C: Likewise. * g++.dg/cpp1z/constexpr-lambda13.C: Likewise. * g++.dg/cpp1z/aggr-base2a.C: Likewise. * g++.dg/cpp1z/nontype-auto1.C: Likewise. * g++.dg/cpp1z/constexpr-lambda3.C: Likewise. * g++.dg/cpp1z/nontype-auto7.C: Likewise. * g++.dg/cpp1z/decomp15.C: Likewise. * g++.dg/cpp1z/noexcept-type4.C: Likewise. * g++.dg/cpp1z/fold-mangle.C: Likewise. * g++.dg/cpp1z/class-deduction35.C: Likewise. * g++.dg/cpp1z/decomp4.C: Likewise. * g++.dg/cpp1z/class-deduction42.C: Likewise. * g++.dg/cpp1z/init-statement8.C: Likewise. * g++.dg/cpp1z/inline-var1a.C: Likewise. * g++.dg/cpp1z/init-statement6.C: Likewise. * g++.dg/cpp1z/class-deduction17.C: Likewise. * g++.dg/cpp1z/class-deduction28.C: Likewise. * g++.dg/cpp1z/class-deduction27.C: Likewise. * g++.dg/cpp1z/decomp-bitfield1.C: Likewise. * g++.dg/cpp1z/attributes-enum-1a.C: Likewise. * g++.dg/cpp1z/class-deduction11.C: Likewise. * g++.dg/cpp1z/constexpr-lambda12.C: Likewise. * g++.dg/cpp1z/init-statement9.C: Likewise. * g++.dg/cpp1z/class-deduction19.C: Likewise. * g++.dg/cpp1z/class-deduction5.C: Likewise. * g++.dg/cpp1z/fold2.C: Likewise. * g++.dg/cpp1z/class-deduction33.C: Likewise. * g++.dg/cpp1z/class-deduction24.C: Likewise. * g++.dg/cpp1z/aggr-base1.C: Likewise. * g++.dg/cpp1z/fold6.C: Likewise. * g++.dg/cpp1z/decomp12.C: Likewise. * g++.dg/cpp1z/class-deduction4.C: Likewise. * g++.dg/cpp1z/inline-var1.C: Likewise. * g++.dg/cpp1z/aligned-new2.C: Likewise. * g++.dg/cpp1z/class-deduction3.C: Likewise. * g++.dg/other/error3.C: Likewise. * g++.dg/init/new25.C: Likewise. * g++.dg/init/new13.C: Likewise. * g++.dg/tls/diag-2.C: Likewise. * g++.dg/tls/diag-4.C: Likewise. * g++.dg/opt/noreturn-1.C: Likewise. * g++.dg/eh/async-unwind2.C: Likewise. * g++.dg/eh/spec9.C: Likewise. * g++.dg/eh/spec7.C: Likewise. * g++.dg/eh/template1.C: Likewise. * g++.dg/eh/cond4.C: Likewise. * g++.dg/eh/pr41819.C: Likewise. * g++.dg/eh/delete1.C: Likewise. * g++.dg/eh/spec3.C: Likewise. * g++.dg/eh/forced4.C: Likewise. * g++.dg/eh/spec2.C: Likewise. * g++.dg/eh/shadow1.C: Likewise. * g++.dg/eh/pr38662.C: Likewise. * g++.dg/eh/ehopt1.C: Likewise. * g++.dg/eh/spec8.C: Likewise. * g++.dg/eh/init-temp2.C: Likewise. * g++.dg/rtti/crash3.C: Likewise. * g++.dg/warn/Wreturn-type-3.C: Likewise. * g++.dg/warn/register-parm-1.C: Likewise. * g++.dg/warn/register-var-2.C: Likewise. * g++.dg/gcov/gcov-7.C: Likewise. * g++.dg/tree-ssa/pr45605.C: Likewise. * g++.dg/cpp/pr23827_cxx98_neg.C: Likewise. * g++.dg/lookup/exception1.C: Likewise. * g++.dg/ubsan/pr79589.C: Likewise. * g++.dg/tm/pr47340.C: Likewise. * g++.dg/tm/pr46567.C: Likewise. * g++.dg/expr/bitfield5.C: Likewise. * g++.dg/expr/bool1.C: Likewise. * g++.dg/expr/lval3.C: Likewise. * g++.dg/expr/lval4.C: Likewise. * g++.dg/expr/bitfield4.C: Likewise. * g++.dg/expr/bitfield6.C: Likewise. * g++.dg/expr/bool3.C: Likewise. * g++.dg/ext/has_nothrow_constructor.C: Likewise. * g++.dg/ext/has_nothrow_copy-7.C: Likewise. * g++.dg/ext/has_nothrow_copy-1.C: Likewise. * g++.dg/ext/has_nothrow_copy-2.C: Likewise. * g++.dg/ext/has_nothrow_copy-4.C: Likewise. * g++.dg/ext/has_nothrow_copy-5.C: Likewise. * g++.dg/ext/has_nothrow_copy-6.C: Likewise. * g++.dg/ext/has_nothrow_assign.C: Likewise. * g++.dg/parse/register1.C: Likewise. * g++.dg/parse/error15.C: Likewise. * g++.dg/parse/linkage2.C: Likewise. * g++.dg/concepts/intro2.C: Likewise. * g++.dg/concepts/class.C: Likewise. * g++.dg/concepts/traits1.C: Likewise. * g++.dg/concepts/req5.C: Likewise. * g++.dg/concepts/var-concept5.C: Likewise. * g++.dg/concepts/fn-concept2.C: Likewise. * g++.dg/concepts/traits2.C: Likewise. * g++.dg/concepts/placeholder2.C: Likewise. * g++.dg/concepts/class6.C: Likewise. * g++.dg/concepts/memtmpl1.C: Likewise. * g++.dg/concepts/friend2.C: Likewise. * g++.dg/concepts/template-parm3.C: Likewise. * g++.dg/concepts/template-parm10.C: Likewise. * g++.dg/concepts/explicit-spec1.C: Likewise. * g++.dg/concepts/explicit-spec3.C: Likewise. * g++.dg/concepts/var-templ2.C: Likewise. * g++.dg/concepts/intro5.C: Likewise. * g++.dg/concepts/deduction-constraint1.C: Likewise. * g++.dg/concepts/iconv1.C: Likewise. * g++.dg/concepts/constrained-parm.C: Likewise. * g++.dg/concepts/template-template-parm1.C: Likewise. * g++.dg/concepts/var-concept3.C: Likewise. * g++.dg/concepts/class3.C: Likewise. * g++.dg/concepts/memfun2.C: Likewise. * g++.dg/concepts/req1.C: Likewise. * g++.dg/concepts/disjunction1.C: Likewise. * g++.dg/concepts/req17.C: Likewise. * g++.dg/concepts/pr65848.C: Likewise. * g++.dg/concepts/placeholder4.C: Likewise. * g++.dg/concepts/decl-diagnose.C: Likewise. * g++.dg/concepts/intro7.C: Likewise. * g++.dg/concepts/pr68683.C: Likewise. * g++.dg/concepts/partial-spec4.C: Likewise. * g++.dg/concepts/template-parm5.C: Likewise. * g++.dg/concepts/explicit-inst1.C: Likewise. * g++.dg/concepts/class-deduction1.C: Likewise. * g++.dg/concepts/class1.C: Likewise. * g++.dg/concepts/req15.C: Likewise. * g++.dg/concepts/memfun.C: Likewise. * g++.dg/concepts/pr68434.C: Likewise. * g++.dg/concepts/inherit-ctor4.C: Likewise. * g++.dg/concepts/partial-spec6.C: Likewise. * g++.dg/concepts/var-templ1.C: Likewise. * g++.dg/concepts/template-parm8.C: Likewise. * g++.dg/concepts/explicit-inst3.C: Likewise. * g++.dg/concepts/class4.C: Likewise. * g++.dg/concepts/req6.C: Likewise. * g++.dg/concepts/fn8.C: Likewise. * g++.dg/concepts/class5.C: Likewise. * g++.dg/concepts/placeholder5.C: Likewise. * g++.dg/concepts/req16.C: Likewise. * g++.dg/concepts/req10.C: Likewise. * g++.dg/concepts/var-concept2.C: Likewise. * g++.dg/concepts/auto3.C: Likewise. * g++.dg/concepts/generic-fn-err.C: Likewise. * g++.dg/concepts/pr65552.C: Likewise. * g++.dg/concepts/partial-concept-id2.C: Likewise. * g++.dg/concepts/fn1.C: Likewise. * g++.dg/concepts/partial-spec.C: Likewise. * g++.dg/concepts/template-parm12.C: Likewise. * g++.dg/concepts/diagnostic1.C: Likewise. * g++.dg/concepts/intro1.C: Likewise. * g++.dg/concepts/explicit-inst4.C: Likewise. * g++.dg/concepts/req18.C: Likewise. * g++.dg/concepts/explicit-spec5.C: Likewise. * g++.dg/concepts/var-concept6.C: Likewise. * g++.dg/concepts/fn9.C: Likewise. * g++.dg/concepts/req2.C: Likewise. * g++.dg/concepts/template-parm7.C: Likewise. * g++.dg/concepts/req14.C: Likewise. * g++.dg/concepts/template-parm6.C: Likewise. * g++.dg/concepts/variadic4.C: Likewise. * g++.dg/concepts/fn6.C: Likewise. * g++.dg/concepts/req-neg1.C: Likewise. * g++.dg/concepts/alias3.C: Likewise. * g++.dg/concepts/expression2.C: Likewise. * g++.dg/concepts/partial-spec3.C: Likewise. * g++.dg/concepts/expression3.C: Likewise. * g++.dg/concepts/memfun-err.C: Likewise. * g++.dg/concepts/pr66091.C: Likewise. * g++.dg/concepts/explicit-spec2.C: Likewise. * g++.dg/concepts/equiv.C: Likewise. * g++.dg/concepts/friend1.C: Likewise. * g++.dg/concepts/fn4.C: Likewise. * g++.dg/concepts/var-templ3.C: Likewise. * g++.dg/concepts/explicit-inst2.C: Likewise. * g++.dg/concepts/alias2.C: Likewise. * g++.dg/concepts/regress/alias-decl-42.C: Likewise. * g++.dg/concepts/placeholder6.C: Likewise. * g++.dg/concepts/fn10.C: Likewise. * g++.dg/concepts/req3.C: Likewise. * g++.dg/concepts/variadic2.C: Likewise. * g++.dg/concepts/pr65636.C: Likewise. * g++.dg/concepts/intro6.C: Likewise. * g++.dg/concepts/class2.C: Likewise. * g++.dg/concepts/fn2.C: Likewise. * g++.dg/concepts/req20.C: Likewise. * g++.dg/concepts/req8.C: Likewise. * g++.dg/concepts/placeholder1.C: Likewise. * g++.dg/concepts/pr65854.C: Likewise. * g++.dg/concepts/member-concept.C: Likewise. * g++.dg/concepts/template-parm2.C: Likewise. * g++.dg/concepts/variadic1.C: Likewise. * g++.dg/concepts/fn7.C: Likewise. * g++.dg/concepts/intro4.C: Likewise. * g++.dg/concepts/req13.C: Likewise. * g++.dg/concepts/inherit-ctor3.C: Likewise. * g++.dg/concepts/explicit-spec6.C: Likewise. * g++.dg/concepts/auto1.C: Likewise. * g++.dg/concepts/alias1.C: Likewise. * g++.dg/concepts/fn-concept1.C: Likewise. * g++.dg/concepts/template-parm11.C: Likewise. * g++.dg/concepts/explicit-spec4.C: Likewise. * g++.dg/concepts/partial-concept-id1.C: Likewise. * g++.dg/concepts/req9.C: Likewise. * g++.dg/concepts/req4.C: Likewise. * g++.dg/concepts/pr65681.C: Likewise. * g++.dg/concepts/req7.C: Likewise. * g++.dg/concepts/req12.C: Likewise. * g++.dg/concepts/fn5.C: Likewise. * g++.dg/concepts/alias4.C: Likewise. * g++.dg/concepts/generic-fn.C: Likewise. * g++.dg/concepts/feature-macro.C: Likewise. * g++.dg/concepts/req19.C: Likewise. * g++.dg/concepts/placeholder3.C: Likewise. * g++.dg/concepts/intro3.C: Likewise. * g++.dg/concepts/partial-spec5.C: Likewise. * g++.dg/concepts/template-parm4.C: Likewise. * g++.dg/concepts/dr1430.C: Likewise. * g++.dg/concepts/pr65634.C: Likewise. * g++.dg/concepts/var-concept4.C: Likewise. * g++.dg/concepts/pr67249.C: Likewise. * g++.dg/concepts/expression.C: Likewise. * g++.dg/concepts/pr65575.C: Likewise. * g++.dg/concepts/partial-spec2.C: Likewise. * g++.dg/concepts/template-parm9.C: Likewise. * g++.dg/concepts/inherit-ctor1.C: Likewise. * g++.dg/concepts/equiv2.C: Likewise. * g++.dg/concepts/req11.C: Likewise. * g++.dg/concepts/template-parm1.C: Likewise. * g++.dg/concepts/inherit-ctor2.C: Likewise. * g++.dg/concepts/var-concept1.C: Likewise. * g++.dg/concepts/fn3.C: Likewise. * g++.dg/torture/pr46364.C: Likewise. * g++.dg/torture/stackalign/eh-alloca-1.C: Likewise. * g++.dg/torture/stackalign/eh-fastcall-1.C: Likewise. * g++.dg/torture/stackalign/eh-vararg-1.C: Likewise. * g++.dg/torture/stackalign/eh-vararg-2.C: Likewise. * g++.dg/torture/stackalign/eh-global-1.C: Likewise. * g++.dg/torture/stackalign/eh-thiscall-1.C: Likewise. * g++.dg/torture/stackalign/eh-inline-2.C: Likewise. * g++.dg/torture/stackalign/eh-inline-1.C: Likewise. * g++.dg/torture/pr52918-1.C: Likewise. * g++.dg/torture/pr49394.C: Likewise. * g++.dg/torture/pr57190.C: Likewise. * g++.dg/cpp0x/static_assert8.C: Likewise. * g++.dg/cpp0x/noexcept19.C: Likewise. * g++.dg/cpp0x/variadic-throw.C: Likewise. * g++.dg/cpp0x/variadic73.C: Likewise. * g++.dg/cpp0x/noexcept02.C: Likewise. * g++.dg/cpp0x/defaulted23.C: Likewise. * g++.dg/cpp0x/noexcept08.C: Likewise. * g++.dg/cpp0x/auto9.C: Likewise. * g++.dg/cpp0x/lambda/lambda-eh2.C: Likewise. * g++.dg/cpp0x/error5.C: Likewise. * c-c++-common/gomp/atomic-12.c: Likewise. * c-c++-common/gomp/atomic-13.c: Likewise. * c-c++-common/gomp/atomic-14.c: Likewise. * c-c++-common/Wvarargs-2.c: Likewise. * c-c++-common/Wvarargs.c: Likewise. * c-c++-common/vector-subscript-2.c: Likewise. * g++.old-deja/g++.robertl/eb123.C: Likewise. * g++.old-deja/g++.eh/tmpl3.C: Likewise. * g++.old-deja/g++.eh/cleanup2.C: Likewise. * g++.old-deja/g++.eh/badalloc1.C: Likewise. * g++.old-deja/g++.eh/throw2.C: Likewise. * g++.old-deja/g++.eh/throw1.C: Likewise. * g++.old-deja/g++.eh/tmpl1.C: Likewise. * g++.old-deja/g++.other/new7.C: Likewise. * g++.old-deja/g++.other/crash30.C: Likewise. * g++.old-deja/g++.other/regstack.C: Likewise. * g++.old-deja/g++.other/crash28.C: Likewise. * g++.old-deja/g++.jason/bool5.C: Likewise. * g++.old-deja/g++.mike/p10416.C: Likewise. * g++.old-deja/g++.mike/eh25.C: Likewise. * g++.old-deja/g++.mike/eh55.C: Likewise. libcpp/ * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17. * init.c (lang_defaults, cpp_init_builtins): Likewise. * expr.c (cpp_classify_number): Use C++17 instead of C++1z in diagnostics. libstdc++-v3/ * testsuite/libstdc++-prettyprinters/cxx17.cc: Use -std=c++17 or -std=gnu++17 instead of -std=c++1z or -std=gnu++1z. Use c++17 instead of c++1z and c++17_only instead of c++1z_only. Adjust expected diagnostics and comments refering to 1z to 17. * testsuite/30_threads/lock_guard/cons/deduction.cc: Likewise. * testsuite/30_threads/scoped_lock/cons/deduction.cc: Likewise. * testsuite/30_threads/scoped_lock/cons/1.cc: Likewise. * testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/scoped_lock/requirements/explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/cons/deduction.cc: Likewise. * testsuite/18_support/launder/1.cc (test02): Likewise. * testsuite/18_support/launder/requirements_neg.cc: Likewise. * testsuite/18_support/launder/requirements.cc: Likewise. * testsuite/18_support/byte/requirements.cc: Likewise. * testsuite/18_support/byte/ops.cc: Likewise. * testsuite/18_support/byte/global_neg.cc: Likewise. * testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc: Likewise. * testsuite/27_io/types/4.cc: Likewise. * testsuite/25_algorithms/sample/81221.cc: Likewise. * testsuite/25_algorithms/sample/1.cc: Likewise. * testsuite/25_algorithms/sample/2.cc: Likewise. * testsuite/25_algorithms/search/searcher.cc: Likewise. * testsuite/28_regex/basic_regex/ctors/deduction.cc: Likewise. * testsuite/experimental/filesystem/path/construct/string_view.cc: Likewise. * testsuite/24_iterators/range_access_cpp17.cc: Likewise. * testsuite/24_iterators/container_access.cc: Likewise. * testsuite/ext/pb_ds/regression/hash_map_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/trie_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/hash_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/list_update_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/list_update_map_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/priority_queue_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/tree_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/tree_map_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/trie_map_rand.cc: Likewise. * testsuite/20_util/shared_ptr/casts/reinterpret.cc: Likewise. * testsuite/20_util/shared_ptr/cons/deduction.cc: Likewise. * testsuite/20_util/shared_ptr/cons/array.cc: Likewise. * testsuite/20_util/shared_ptr/observers/array.cc (struct A): Likewise. * testsuite/20_util/pair/cons/deduction.cc: Likewise. * testsuite/20_util/variant/deduction.cc: Likewise. * testsuite/20_util/tuple/78939.cc: Likewise. * testsuite/20_util/tuple/cons/deduction.cc: Likewise. * testsuite/20_util/void_t/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Likewise. * testsuite/20_util/unique_ptr/cons/deduction_neg.cc: Likewise. * testsuite/20_util/addressof/requirements/constexpr.cc: Likewise. * testsuite/20_util/weak_ptr/cons/deduction.cc: Likewise. * testsuite/20_util/has_unique_object_representations/requirements/typedefs.cc: Likewise. * testsuite/20_util/has_unique_object_representations/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/has_unique_object_representations/value.cc: Likewise. * testsuite/20_util/time_point/arithmetic/constexpr.cc: Likewise. * testsuite/20_util/function_objects/invoke/59768.cc: Likewise. * testsuite/20_util/function_objects/mem_fn/80478.cc: Likewise. * testsuite/20_util/function/cons/deduction.cc: Likewise. * testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc: Likewise. * testsuite/20_util/is_aggregate/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_aggregate/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_aggregate/value.cc: Likewise. * testsuite/26_numerics/lcm/1.cc: Likewise. * testsuite/26_numerics/lcm/lcm_neg.cc: Likewise. * testsuite/26_numerics/gcd/1.cc: Likewise. * testsuite/26_numerics/gcd/gcd_neg.cc: Likewise. * testsuite/26_numerics/valarray/deduction.cc: Likewise. * testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Likewise. * testsuite/26_numerics/headers/cmath/hypot.cc: Likewise. * testsuite/23_containers/queue/members/emplace_cxx17_return.cc: Likewise. * testsuite/23_containers/array/cons/deduction.cc: Likewise. * testsuite/23_containers/array/cons/deduction_neg.cc: Likewise. * testsuite/23_containers/deque/modifiers/emplace/cxx17_return.cc: Likewise. * testsuite/23_containers/deque/cons/deduction.cc: Likewise. * testsuite/23_containers/stack/members/emplace_cxx17_return.cc: Likewise. * testsuite/23_containers/list/modifiers/emplace/cxx17_return.cc: Likewise. * testsuite/23_containers/list/cons/deduction.cc: Likewise. * testsuite/23_containers/forward_list/modifiers/emplace_cxx17_return.cc: Likewise. * testsuite/23_containers/forward_list/cons/deduction.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Likewise. * testsuite/23_containers/vector/modifiers/emplace/cxx17_return.cc: Likewise. * testsuite/23_containers/vector/cons/deduction.cc: Likewise. * testsuite/23_containers/vector/bool/emplace_cxx17_return.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/9.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/deduction.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/79162.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/9.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/79162.cc: Likewise. * testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc: Likewise. * testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc: Likewise. * testsuite/21_strings/basic_string_view/operations/compare/char/2.cc: Likewise. * testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc: Likewise. * testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc: Likewise. * testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc: Likewise. From-SVN: r252826
2017-08-29PR c++/81236 - ICE with template-id in generic lambdaJason Merrill1-1/+5
* semantics.c (finish_id_expression): Remove special dependent case. Avoid some later pieces when dependent. (finish_qualified_id_expr): Do normal BASELINK handling in a template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR. (parsing_default_capturing_generic_lambda_in_template): Remove. * parser.c (cp_parser_postfix_dot_deref_expression): Always give an error for types that will never be complete. * mangle.c (write_expression): Add sanity check. * tree.c (build_qualified_name): Add sanity check. (cp_walk_subtrees): Walk into the class context of a BASELINK. * lambda.c (add_capture): Improve diagnostic for generic lambda capture failure. * call.c (build_new_method_call_1): Print the right constructor name. From-SVN: r251438
2017-08-29Reimplement handling of lambdas in templates.Jason Merrill1-0/+83
* cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P. * decl.c (start_preparsed_function): Call start_lambda_scope. (finish_function): Call finish_lambda_scope. * init.c (get_nsdmi): Call start/finish_lambda_scope. * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function. * parser.c (cp_parser_function_definition_after_declarator): Don't call start/finish_lambda_scope. * pt.c (retrieve_specialization): Ignore lambda functions in templates. (find_parameter_packs_r): Ignore capture proxies. Look into lambdas. (check_for_bare_parameter_packs): Allow bare packs in lambdas. (tsubst_default_argument): Call start/finish_lambda_scope. (tsubst_function_decl): Handle lambda functions differently. (tsubst_template_decl): Likewise. (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture proxies. (tsubst_lambda_expr): Create a new closure rather than instantiate the one from the template. (tsubst_copy_and_build): Don't register a specialization of a pack. (regenerate_decl_from_template): Call start/finish_lambda_scope. (instantiate_decl): Remove special lambda function handling. * semantics.c (process_outer_var_ref): Remove special generic lambda handling. Don't implicitly capture in a lambda in a template. Look for an existing proxy. * class.c (current_nonlambda_class_type): Use decl_type_context. From-SVN: r251433
2017-08-29Remove unnecessary LAMBDA_EXPR fields.Jason Merrill1-1/+0
* cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE. (LAMBDA_EXPR_RETURN_TYPE): Remove. (struct tree_lambda_expr): Remove closure and return_type fields. * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE. * pt.c (tsubst_copy_and_build): Likewise. * parser.c (cp_parser_lambda_declarator_opt): Track return type. (cp_parser_lambda_body): Adjust unspecified return type check. * ptree.c (cxx_print_lambda_node): Don't print closure or return type. From-SVN: r251430
2017-08-29Various small fixes.Jason Merrill1-1/+1
* lambda.c (build_lambda_object): Check for error_mark_node. * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type pack as well. (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters. (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node. From-SVN: r251428
2017-07-26re PR c++/71570 (ICE on invalid variable capture in ↵Paolo Carlini1-1/+4
cxx_incomplete_type_diagnostic, at cp/typeck2.c:55) /cp 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71570 * lambda.c (add_capture): Early return if we cannot capture by reference. /testsuite 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71570 * g++.dg/cpp0x/lambda/lambda-ice17.C: New. From-SVN: r250591
2017-06-30config-lang.in (gtfiles): Add cp/lex.c.Nathan Sidwell1-1/+1
* config-lang.in (gtfiles): Add cp/lex.c. * cp-tree.h (mangle_convop_name_for_type): Rename ... (make_conv_op_name): ... here. Move to lex. * lambda.c (maybe_add_lambda_conv_op): Update. * parser.c (cp_parser_conversion_function_id): Update. * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy, tsubst_copy_and_build): Update. * semantics.c (apply_deduced_return_type): Update. * mangle.c (conv_type_hasher, conv_type_names, mangle_conv_op_name_for_type): Move to ... * lex.c (conv_type_hasher, conv_type_names, make_convop_name): ... here. Rename. * libcp1plugin.cc (plugin_build_decl): Use make_conv_op_name. (plugin_build_dependent_expr): Likewise. From-SVN: r249852
2017-06-16PR c++/80465 - ICE with generic lambda with noexcept-specifier.Jason Merrill1-4/+5
* lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl set longer for a generic lambda. From-SVN: r249322
2017-06-16cp-tree.h (build_this_parm, [...]): Add FN parm.Nathan Sidwell1-1/+2
gcc/cp/ * cp-tree.h (build_this_parm, cp_build_parm_decl) build_artificial_parm): Add FN parm. * decl.c (start_cleanup_fn): Adjust. (build_this_parm): Add FN parm, pass it through. (grokfndecl): Adjust parm building. * decl2.c (cp_build_parm_decl): Add FN parm, set context. (build_artificial_parm): Add FN parm, pass through. (maybe_retrofit_in_chrg): Adjust parm building. (start_static_storage_duration_function): Likwise. * lambda.c (maybe_aadd_lambda_conv_op): Likewise. * method.c (implicitly_declare_fn): Likewise. * parser.c (inject_this_parameter): Likewise. libcc1/ * libcp1plugin.cc (plugin_build_decl): Adjust parm building. (--This line, and those below, will be ignored-- M gcc/cp/parser.c M gcc/cp/ChangeLog M gcc/cp/decl.c M gcc/cp/lambda.c M gcc/cp/cp-tree.h M gcc/cp/method.c M gcc/cp/decl2.c M libcc1/libcp1plugin.cc M libcc1/ChangeLog From-SVN: r249268
2017-06-13Implement no_sanitize function attributeMartin Liska1-3/+1
2017-06-13 Martin Liska <mliska@suse.cz> PR sanitize/78204 * c-c++-common/ubsan/attrib-2.c (float_cast2): Enhance the test by adding no_sanitize attribute. * gcc.dg/asan/use-after-scope-4.c: Likewise. 2017-06-13 Martin Liska <mliska@suse.cz> PR sanitize/78204 * c-attribs.c (add_no_sanitize_value): New function. (handle_no_sanitize_attribute): Likewise. (handle_no_sanitize_address_attribute): Use the function. (handle_no_sanitize_thread_attribute): New function. (handle_no_address_safety_analysis_attribute): Use add_no_sanitize_value. (handle_no_sanitize_undefined_attribute): Likewise. * c-common.h: Declare new functions. * c-ubsan.c (ubsan_instrument_division): Use sanitize_flags_p. (ubsan_instrument_shift): Likewise. (ubsan_instrument_bounds): Likewise. (ubsan_maybe_instrument_array_ref): Likewise. (ubsan_maybe_instrument_reference_or_call): Likewise. 2017-06-13 Martin Liska <mliska@suse.cz> PR sanitize/78204 * asan.c (asan_sanitize_stack_p): Use sanitize_flags_p. (gate_asan): Likewise. * asan.h (asan_no_sanitize_address_p): Remove the function. (sanitize_flags_p): New function. * builtins.def: Fix coding style. * common.opt: Use renamed enum value. * convert.c (convert_to_integer_1): Use sanitize_flags_p. * doc/extend.texi: Document no_sanitize attribute. * flag-types.h (enum sanitize_code): Rename SANITIZE_NONDEFAULT to SANITIZE_UNDEFINED_NONDEFAULT. * gcc.c (sanitize_spec_function): Use the renamed enum value. * gimple-fold.c (optimize_atomic_compare_exchange_p): Use sanitize_flags_p. * gimplify.c (gimplify_function_tree): Likewise. * ipa-inline.c (sanitize_attrs_match_for_inline_p): Likewise. * opts.c (parse_no_sanitize_attribute): New function. (common_handle_option): Use renamed enum value. * opts.h (parse_no_sanitize_attribute): Declare. * tree.c (sanitize_flags_p): New function. * tree.h: Declared here. * tsan.c: Use sanitize_flags_p. * ubsan.c (ubsan_expand_null_ifn): Likewise. (instrument_mem_ref): Likewise. (instrument_bool_enum_load): Likewise. (do_ubsan_in_current_function): Remove the function. (pass_ubsan::execute): Use sanitize_flags_p. * ubsan.h: Remove do_ubsan_in_current_function * tree-cfg.c (print_no_sanitize_attr_value): New function. (dump_function_to_file): Use it here. 2017-06-13 Martin Liska <mliska@suse.cz> PR sanitize/78204 * class.c (build_base_path): Use sanitize_flags_p. * cp-gimplify.c (cp_genericize_r): Likewise. (cp_genericize_tree): Likewise. (cp_genericize): Likewise. * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise. * decl.c (compute_array_index_type): Likewise. (start_preparsed_function): Likewise. * decl2.c (one_static_initialization_or_destruction): Likewise. * init.c (finish_length_check): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * typeck.c (cp_build_binary_op): Likewise. (build_static_cast_1): Likewise. 2017-06-13 Martin Liska <mliska@suse.cz> PR sanitize/78204 * c-convert.c (convert): Use sanitize_flags_p. * c-decl.c (grokdeclarator): Likewise. * c-typeck.c (convert_for_assignment): Likewise. (c_finish_return): Likewise. (build_binary_op): Likewise. From-SVN: r249158
2017-05-19c-format.c (locus): Move out of function scope, add GTY attribute.Bernd Edlinger1-1/+5
gcc/c-family: 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de> * c-format.c (locus): Move out of function scope, add GTY attribute. gcc/cp: 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de> * config-lang.in (gtfiles): Add c-family/c-format.c, except.c, init.c, lambda.c and friend.c. * class.c (dvirt_fn): Move out of function scope, add GTY attribute. * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise. * init.c (fn): Likewise. * lambda.c (ptr_id, max_id): Likewise. * friend.c (global_friend): Add GTY attribute. From-SVN: r248290
2017-05-16cp-tree.h (class ovl_iterator, [...]): New OVERLOAD iterators.Nathan Sidwell1-12/+9
* cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD iterators. (MAYBE_BASELINK_FUNCTIONS): New. * constraint.cc (resolve_constraint_check): Use lkp_iterator. * decl2.c (maybe_warn_sized_delete): Use ovl_iterator. * lambda.c (maybe_generic_this_capture): Use lkp_iterator. * method.c (inherited_ctor_binfo): Use ovl_iterator. (binfo_inherited_from): Likewise. * parser.c (lookup_literal_operator): Use lkp_iterator. * pt.c (iterative_hash_template_arg): Use lkp_iterator. (print_candidates_1): Likewise. (determine_specialization): Likewise. (resolve_overloaded_unification): Likewise. (resolve_nondeduced_context): Likewise. (type_dependent_expression_p): Likewise. (dependent_template_p): Likewise. * ptree.c (cxx_print_xnode): Likewise. * semantics.c (omp_reduction_lookup): Use lkp_iterator. (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator. * typeck.c (check_template_keyword): Use lkp_iterator. From-SVN: r248112
2017-05-11cp-tree.h (pushdecl, [...]): Move declarations to ...Nathan Sidwell1-2/+2
* cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag) pushtag_top_level_maybe_friend, pushdecl_top_level_and_finish): Move declarations to ... * name-lookup.h: ... here. Group pushdecl variants. (pushdecl_top_level_and_finish): Rename to ... (pushdecl_top_level_with_init): ... here. * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init. * decl2.c (get_guard, handle_tls_init): Likewise. * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise. * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p. * method.c (implicitly_declare_fn): Likewise. * searchc (node_debug_info_needed): Likewise. * name-lookup.c (pushdecl_top_level_and_finish): Rename to ... (pushdecl_top_level_with_init): ... here. (pop_everything): Use namespace_bindings_p. (--This line, and those below, will be ignored-- M cp/ChangeLog M cp/method.c M cp/cp-tree.h M cp/decl.c M cp/lambda.c M cp/rtti.c M cp/name-lookup.c M cp/decl2.c M cp/name-lookup.h M cp/search.c From-SVN: r247902
2017-05-10cp-tree.h (add_method, [...]): Change last arg to bool.Nathan Sidwell1-2/+2
gcc/cp/ * cp-tree.h (add_method, clone_function_decl): Change last arg to bool. * class.c (add_method): Change third arg to bool. Adjust. (one_inheriting_sig, one_inherited_ctor): Adjust. (clone_function_decl): Change 2nd arg to bool. Adjust. (clone_constructors_and_destructors): Adjust. * lambda.c (maybe_add_lambda_conv_op): Adjust. * method.c (lazily_declare_fn): Adjust. * pt.c (tsubst_decl, instantiate_template_1): Adjust. * semantics.c (finish_member_declaration): Adjust. libcc1/ * libcp1plugin.cc (plugin_build_decl): Adjust add_method call. From-SVN: r247834
2017-05-08name-lookup.h (pushdecl_with_scope): Replace with ...Nathan Sidwell1-13/+2
* name-lookup.h (pushdecl_with_scope): Replace with ... (pushdecl_outermost_localscope): ... this. * name-lookup.c (pushdecl_with_scope): Replace with ... (pushdecl_outermost_localscope): ... this. (pushdecl_namespace_level): Adjust. * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope. * lambda.c (insert_capture_proxy): Likewise. From-SVN: r247752
2017-01-31re PR c++/79264 (ICE verify_type failed)Nathan Sidwell1-6/+14
PR c++/79264 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs. * semantics.c (finish_member_declaration): Assert class is being defined. PR c++/79264 * g++.dg/cpp1y/pr61636-1.C: Augment. From-SVN: r245065
2017-01-31Introduce C++ support in libcc1Alexandre Oliva1-1/+1
Extend libcc1's with an API for C++ support. Extend libcc1's C API to distinguish between integral types with the same width, as in C++. Likewise for float types. Export small bits of functionality from the C++ front-end for use in libcc1. Add support for the C++ front-end to look up names and addresses using a libcc1-registered binding oracle. Add support for global friends. for gcc/cp/ChangeLog Introduce C++ support in libcc1. * cp-tree.h (struct lang_identifier): Add oracle_looked_up. (ansi_opname): Rename to... (cp_operator_id): ... this. Adjust all callers. (ansi_assopname): Rename to... (cp_assignment_operator_id): ... this. Adjust all callers. (cp_literal_operator_id): Declare. (set_global_friend): Declare. (is_global_friend): Declare. (enum cp_oracle_request): New type. (cp_binding_oracle_function): New type. (cp_binding_oracle): Declare. (cp_finish_injected_record_type): Declare. * friend.c (global_friend): New var. (set_global_friend): New fn. (is_global_friend): New fn. (is_friend): Call is_global_friend. * name-lookup.c (cp_binding_oracle): New var. (query_oracle): New fn. (qualified_lookup_using_namespace): Call query_oracle. (lookup_name_real_1): Likewise. * parser.c (cp_literal_operator_id): Drop static. * search.c (friend_accessible_p): Call is_global_friend. * semantics.c (is_this_parameter): Accept a variable if the binding oracle is enabled. for include/ChangeLog Introduce C++ support in libcc1. * gcc-c-fe.def (int_type_v0): Rename from... (int_type): ... this. Introduce new version. (float_type_v0): Rename from... (float_type): ... this. Introduce new version. (char_type): New. * gcc-c-interface.h (gcc_c_api_version): Add GCC_C_FE_VERSION_1. (gcc_type_array): Move... * gcc-interface.h: ... here. * gcc-cp-fe.def: New. * gcc-cp-interface.h: New. for libcc1/ChangeLog Introduce C++ support. * Makefile.am (AM_CPPFLAGS): Move some -I flags to... (CPPFLAGS_FOR_C_FAMILY, CPPFLAGS_FOR_C, CPPFLAGS_FOR_CXX): ... new macros. (plugin_LTLIBRARIES): Add libcp1plugin.la. (BUILT_SOURCES, MOSTLYCLEANFILES): Add... (cp-compiler-name.h): ... this. New. (c-compiler-name.h): Rename all over from... (compiler-name.h): ... this. Create it atomically. (marshall_c_source, marshall_cxx_source): New macros. (libcc1plugin_la_SOURCES): Rename plugin.cc to libcc1plugin.cc. Add marshall_c_source expansion. (libcc1plugin.lo_CPPFLAGS): New macro. (libcp1plugin_la_LDFLAGS): Likewise. (libcp1plugin_la_SOURCES): Likewise. (libcp1plugin.lo_CPPFLAGS): Likewise. (libcp1plugin_la_LIBADD): Likewise. (libcp1plugin_la_DEPENDENCIES): Likewise. (libcp1plugin_la_LINK): Likewise. (libcc1_la_SOURCES): Added marshall_c_source and marshall_cxx_source expansions. * Makefile.in: Rebuild. * compiler-name.h: Rename all over to... * c-compiler-name.h: ... this. Define C_COMPILER_NAME instead of COMPILER_NAME. * plugin.cc: Rename all over to... * libcc1plugin.cc: ... this. Include marshall-c.hh. (address_rewriter): Drop cleaning up of VLA sizes. (plugin_build_decl): Mark decls as external. (plugin_tagbind): Propagate name to all variants. (build_anonymous_node): New. (plugin_build_record_type): Use it instead of make_node. (plugin_build_union_type): Likewise. (plugin_build_enum_type): Likewise. (plugin_finish_record_or_union): Update all type variants. (safe_lookup_builtin_type): New. (plugin_int_check): Factor out of, and add checks to, ... (plugin_int_type): ... this. Rename to... (plugin_int_type_v0): ... this. (plugin_int_type): New interface, new implementation. (plugin_char_type): New. (plugin_float_type_v0): Rename from... (plugin_float_type): ... this. New interface, new implementation. (plugin_init): Bump handshake version. * libcc1.cc: Include marshall-c.hh. Drop gcc-interface.h. (call_binding_oracle): Rename to... (c_call_binding_oracle): ... this, into anonymous namespace. (call_symbol_address): Rename to... (c_call_symbol_address): ... this, likewise. (GCC_METHOD#): Move methods into cc1plugin::c:: namespace. (libcc1::compiler::find): Refer to C_COMPILER_NAME. (fork_exec): Bump to GCC_C_FE_VERSION_1. (libcc1_compile): Prefix callbacks with c_. (gcc_c_fe_context): Accept GCC_C_FE_VERSION_1. * libcc1.sym: Export gcc_cp_fe_context. * libcp1.cc: New, mostly copied and adjusted from libcc1.cc. * libcp1plugin.cc: New, initially copied from libcc1plugin.cc. * libcp1plugin.sym: New. * marshall-c.hh: New. Move C-specific types from... * marshall.cc: ... this. (cc1_plugin::marshall_array_start): New. (cc1_plugin::marshall_array_elmts): New. (cc1_plugin::marshall for gcc_type_array): Use the above. (cc1_plugin::unmarshall_array_start): New. (cc1_plugin::unmarshall_array_elmts): New. (cc1_plugin::unmarshall for gcc_type_array): Use the above. * marshall.hh: Declare the new array building blocks. Drop C-specific unmarshall declarations. * marshall-cp.hh: New. * names.cc (GCC_METHOD#): Add LANG:: to method names. (LANG): Define while including gcc-c-fe.def and gcc-cp-fe.def. * names.hh: Include gcc-c-fe.def and gcc-cp-fe.def in the corresponding namespaces. * rpc.hh: Don't include marshall.hh. [GCC_CP_INTERFACE_H] (argument_wrapper): Specialize for gcc_vbase_array, gcc_cp_template_args, gcc_cp_function_args. From-SVN: r245051
2017-01-17re PR c++/61636 (generic lambda: segfault / "cannot call member function ↵Nathan Sidwell1-13/+48
without object") PR c++/61636 * cp-tree.h (maybe_generic_this_capture): Declare. * lambda.c (resolvable_dummy_lambda): New, broken out of ... (maybe_resolve_dummy): ... here. Call it. (maybe_generic_this_capture): New. * parser.c (cp_parser_postfix_expression): Speculatively capture this in generic lambda in unresolved member function call. * pt.c (tsubst_copy_and_build): Force hard error from failed member function lookup in generic lambda. PR c++/61636 * g++.dg/cpp1y/pr61636-1.C: New. * g++.dg/cpp1y/pr61636-2.C: New. * g++.dg/cpp1y/pr61636-3.C: New. From-SVN: r244544
2017-01-04re PR c++/66735 ([C++14] lambda init-capture fails for const references)Nathan Sidwell1-11/+31
cp/ PR c++/66735 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New. (lambda_capture_field_type): Update prototype. * lambda.c (lambda_capture_field_type): Add is_reference parm. Add referenceness here. (add_capture): Adjust lambda_capture_field_type call, refactor error checking. * pt.c (tsubst): Adjust lambda_capture_field_type call. testsuite/ PR c++/66735 * g++.dg/cpp1y/pr66735.C: New. From-SVN: r244056
2017-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r243994
2016-11-07Implement P0012R1, Make exception specifications part of the type system.Jason Merrill1-0/+3
gcc/cp/ * cp-tree.h (enum tsubst_flags): Add tf_fndecl_type. (flag_noexcept_type, ce_type): New. * call.c (build_conv): Add ck_fnptr. (enum conversion_kind): Change ck_tsafe to ck_fnptr. (convert_like_real): Likewise. (standard_conversion): Likewise. Allow function pointer conversions for pointers to member functions. (reference_compatible_p): Allow function pointer conversions. (direct_reference_binding): Likewise. (reference_binding): Reference-compatible is no longer a subset of reference-related. (is_subseq): Also strip ck_lvalue after next_conversion. * class.c (instantiate_type): Check fnptr_conv_p. (resolve_address_of_overloaded_function): Likewise. * cvt.c (can_convert_tx_safety): Now static. (noexcept_conv_p, fnptr_conv_p, strip_fnptr_conv): New. * decl.c (flag_noexcept_type): Define. (cxx_init_decl_processing): Set it. (bad_specifiers): Check it. (grokdeclarator) [cdk_function]: Add exception-spec to type here. * lambda.c (maybe_add_lambda_conv_op): Add exception-spec to returned pointer. * mangle.c (struct globals): Add need_cxx1z_warning. (mangle_decl): Check it. (write_exception_spec): New. (write_function_type): Call it. (canonicalize_for_substitution): Handle exception spec. (write_type): Likewise. (write_encoding): Set processing_template_decl across mangling of partially-instantiated type. * pt.c (determine_specialization): Pass tf_fndecl_type. (tsubst_decl, fn_type_unification): Likewise. (tsubst): Strip tf_fndecl_type, pass it to tsubst_exception_specification. (convert_nontype_argument_function): Handle function pointer conversion. (convert_nontype_argument): Likewise. (unify, for_each_template_parm_r): Walk into noexcept-specifier. * rtti.c (ptr_initializer): Encode noexcept. * tree.c (canonical_eh_spec): New. (build_exception_variant): Use it. * typeck.c (composite_pointer_type): Handle fnptr conversion. (comp_except_specs): Compare canonical EH specs. (structural_comptypes): Call it. gcc/c-family/ * c.opt (Wc++1z-compat): New. * c-cppbuiltin.c (c_cpp_builtins): Add __cpp_noexcept_function_type. libstdc++-v3/ * include/bits/c++config (_GLIBCXX_NOEXCEPT_PARM) (_GLIBCXX_NOEXCEPT_QUAL): New. * include/std/type_traits (is_function): Use them. * libsubc++/new (launder): Likewise. * libsupc++/cxxabi.h (__pbase_type_info::__masks): Add __noexcept_mask. * libsupc++/pbase_type_info.cc (__do_catch): Handle function pointer conversion. libiberty/ * cp-demangle.c (is_fnqual_component_type): New. (d_encoding, d_print_comp_inner, d_print_mod_list): Use it. (FNQUAL_COMPONENT_CASE): New. (d_make_comp, has_return_type, d_print_comp_inner) (d_print_function_type): Use it. (next_is_type_qual): New. (d_cv_qualifiers, d_print_mod): Handle noexcept and throw-spec. include/ * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_NOEXCEPT, DEMANGLE_COMPONENT_THROW_SPEC. From-SVN: r241944
2016-10-07Fix profiled bootstrap (part 2)Martin Liska1-1/+1
* lambda.c (maybe_add_lambda_conv_op): Set default value. From-SVN: r240856
2016-09-27Implement P0018R3, C++17 lambda capture of *this by value as [=,*this]Jakub Jelinek1-4/+19
Implement P0018R3, C++17 lambda capture of *this by value as [=,*this] * parser.c (cp_parser_lambda_introducer): Formatting fix. Pass true instead of false as by_reference_p to add_capture for 'this'. Parse '*this' simple-capture. * lambda.c (build_capture_proxy): Handle '*this' capture by value. (add_capture): Adjust function comment. For id == this_identifier, treat by_reference_p as capturing '*this' by reference, i.e. 'this' by value, and !by_reference_p as capturing '*this' by value. (add_default_capture): For implicit 'this' capture, always pass by_reference_p true rather than false. * g++.dg/cpp1z/lambda-this1.C: New test. * g++.dg/cpp1z/lambda-this2.C: New test. From-SVN: r240556
2016-08-09Implement C++17 constexpr lambda.Jason Merrill1-0/+18
gcc/c-family/ * c-cppbuiltin.c (c_cpp_builtins): Update __cpp_constexpr for C++17 constexpr lambdas. gcc/cp/ * class.c (finalize_literal_type_property): Handle lambdas. * constexpr.c (is_valid_constexpr_fn): Likewise. No longer static. (explain_invalid_constexpr_fn, cxx_eval_call_expression): Handle lambdas. (cxx_eval_constant_expression): Handle capture proxy. (var_in_constexpr_fn): Don't check for C++14. (var_in_maybe_constexpr_fn): New. (potential_constant_expression_1): Use it. Check DECL_EXPR for declarations not allowed in constexpr function. * decl.c (make_rtl_for_nonlocal_decl): Use var_in_maybe_constexpr_fn. (finish_function): Set DECL_DECLARED_CONSTEXPR_P on lambda members. * lambda.c (begin_lambda_type): Set CLASSTYPE_LITERAL_P. (maybe_add_lambda_conv_op): Clear thunk CALL_EXPR location. (lambda_static_thunk_p): New. * parser.c (cp_keyword_starts_decl_specifier_p): Add RID_CONSTEXPR. (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): New enumerator. (cp_parser_decl_specifier_seq): Handle it. (cp_parser_lambda_declarator_opt): Use cp_parser_decl_specifier_seq. * pt.c (instantiate_class_template_1): Set CLASSTYPE_LITERAL_P. (tsubst_copy_and_build) [CALL_EXPR]: Propagate CALL_FROM_THUNK_P. * error.c (dump_function_decl): Check TFF_NO_TEMPLATE_BINDINGS. (dump_expr) [FUNCTION_DECL]: Pass it. From-SVN: r239268
2016-08-04re PR c++/72800 (ICE on invalid C++14 code with initialized lambda capture: ↵Paolo Carlini1-0/+2
tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in add_capture, at cp/lambda.c:505) /cp 2016-08-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/72800 * lambda.c (add_capture): Check lambda_capture_field_type return value for error_mark_node. /testsuite 2016-08-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/72800 * g++.dg/cpp1y/lambda-ice1.C: New. From-SVN: r239148
2016-08-04Rename TYPE_ANONYMOUS_P to TYPE_UNNAMED_P.Jason Merrill1-1/+1
* cp-tree.h (TYPE_UNNAMED_P): Rename from TYPE_ANONYMOUS_P. (TYPE_WAS_UNNAMED): Rename from TYPE_WAS_ANONYMOUS. * class.c, decl.c, decl2.c, error.c, lambda.c, mangle.c, name-lookup.c, parser.c, pt.c, semantics.c, tree.c: Adjust. From-SVN: r239137
2016-07-25PR c++/71837 - pack expansion in init-captureJason Merrill1-1/+7
* lambda.c (add_capture): Leave a pack expansion in a TREE_LIST. (build_lambda_object): Call build_x_compound_expr_from_list. * pt.c (tsubst) [DECLTYPE_TYPE]: Likewise. From-SVN: r238733
2016-07-08Use lvalue_p instead of real_lvalue_p.Jason Merrill1-1/+1
* cp-tree.h: Unpoison lvalue_p. * call.c, class.c, constexpr.c, cvt.c, init.c, lambda.c, pt.c, tree.c, typeck.c, typeck2.c: Use lvalue_p instead of real_lvalue_p. From-SVN: r238183
2016-07-08* lambda.c (maybe_add_lambda_conv_op): Fix null object argument.Jason Merrill1-4/+5
From-SVN: r238180
2016-05-29re PR c++/71105 (lambdas with default captures improperly have function ↵Paolo Carlini1-1/+3
pointer conversions) /cp 2016-05-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71105 * lambda.c (maybe_add_lambda_conv_op): Early return also when LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE. /testsuite 2016-05-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71105 * g++.dg/cpp0x/lambda/lambda-conv11.C: New. * g++.dg/cpp1y/lambda-conv1.C: Likewise. * g++.dg/cpp1y/lambda-conv2.C: Likewise. From-SVN: r236861
2016-04-27re PR c++/69024 ([cilkpus] cilk_spawn is broken for initializations with ↵Ryan Burn1-0/+1
implicit conversion operators defined) PR c++/69024 PR c++/68997 * cilk.c (cilk_ignorable_spawn_rhs_op): Change to external linkage. (cilk_recognize_spawn): Renamed from recognize_spawn and change to external linkage. (cilk_detect_and_unwrap): Corresponding changes. (extract_free_variables): Don't extract free variables from AGGR_INIT_EXPR slot. * c-common.h (cilk_ignorable_spawn_rhs_op): Prototype. (cilk_recognize_spawn): Likewise. PR c++/69024 PR c++/68997 * cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap instead of cilk_detect_spawn_and_unwrap. * cp-cilkplus.c (is_conversion_operator_function_decl_p): New. (find_spawn): New. (cilk_cp_detect_spawn_and_unwrap): New. * lambda.c: Include cp-cilkplus.h. * parser.c: Include cp-cilkplus.h. * cp-tree.h (cpp_validate_cilk_plus_loop): Move prototype into... * cp-cilkpus.h: New file. PR c++/69024 PR c++/68997 * g++.dg/cilk-plus/CK/pr68001.cc: Fix to not depend on broken diagnostic. * g++.dg/cilk-plus/CK/pr69024.cc: New test. * g++.dg/cilk-plus/CK/pr68997.cc: New test. Co-Authored-By: Jeff Law <law@redhat.com> From-SVN: r235534
2016-04-18tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount.Michael Matz1-1/+1
* tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount. (SET_TYPE_ALIGN, SET_DECL_ALIGN): New. * tree-core.h (tree_type_common.align): Use bit-field. (tree_type_common.spare): New. (tree_decl_common.off_align): Make smaller. (tree_decl_common.align): Use bit-field. * expr.c (expand_expr_addr_expr_1): Use SET_TYPE_ALIGN. * omp-low.c (install_var_field): Use SET_DECL_ALIGN. (scan_sharing_clauses): Ditto. (finish_taskreg_scan): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (omp_finish_file): Ditto. * stor-layout.c (do_type_align): Use SET_DECL_ALIGN. (layout_decl): Ditto. (relayout_decl): Ditto. (finalize_record_size): Use SET_TYPE_ALIGN. (finalize_type_size): Ditto. (finish_builtin_struct): Ditto. (layout_type): Ditto. (initialize_sizetypes): Ditto. * targhooks.c (std_gimplify_va_arg_expr): Use SET_TYPE_ALIGN. * tree-nested.c (insert_field_into_struct): Use SET_TYPE_ALIGN. (lookup_field_for_decl): Use SET_DECL_ALIGN. (get_chain_field): Ditto. (get_trampoline_type): Ditto. (get_nl_goto_field): Ditto. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use SET_DECL_ALIGN. (unpack_ts_type_common_value_fields): Use SET_TYPE_ALIGN. * gimple-expr.c (copy_var_decl): Use SET_DECL_ALIGN. * tree.c (make_node_stat): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (build_qualified_type): Use SET_TYPE_ALIGN. (build_aligned_type, build_range_type_1): Ditto. (build_atomic_base): Ditto. (build_common_tree_nodes): Ditto. * cfgexpand.c (align_local_variable): Use SET_DECL_ALIGN. (expand_one_stack_var_at): Ditto. * coverage.c (build_var): Use SET_DECL_ALIGN. * except.c (init_eh): Ditto. * function.c (assign_parm_setup_block): Ditto. * symtab.c (increase_alignment_1): Ditto. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Ditto. * tree-vect-stmts.c (ensure_base_align): Ditto. * varasm.c (align_variable): Ditto. (assemble_variable): Ditto. (build_constant_desc): Ditto. (output_constant_def_contents): Ditto. * config/arm/arm.c (arm_relayout_function): Use SET_DECL_ALIGN. * config/avr/avr.c (avr_adjust_type_node): Use SET_TYPE_ALIGN. * config/mips/mips.c (mips_std_gimplify_va_arg_expr): Ditto. * config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Ditto. * config/spu/spu.c (spu_build_builtin_va_list): Use SET_DECL_ALIGN. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN. (gnat_to_gnu_field): Ditto. (components_to_record): Ditto. (create_variant_part_from): Ditto. (copy_and_substitute_in_size): Ditto. (substitute_in_type): Ditto. * gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN. (make_packable_type): Ditto. (maybe_pad_type): Ditto. (finish_fat_pointer_type): Ditto. (finish_record_type): Ditto and use SET_DECL_ALIGN. (rest_of_record_type_compilation): Use SET_TYPE_ALIGN. (create_field_decl): Use SET_DECL_ALIGN. c-family/ * c-common.c (handle_aligned_attribute): Use SET_TYPE_ALIGN and SET_DECL_ALIGN. c/ * c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN. cp/ * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (layout_class_type): Ditto. (build_base_field): Use SET_DECL_ALIGN. (fixup_attribute_variants): Use SET_TYPE_ALIGN. * decl.c (duplicate_decls): Use SET_DECL_ALIGN. (record_unknown_type): Use SET_TYPE_ALIGN. (cxx_init_decl_processing): Ditto. (copy_type_enum): Ditto. (grokfndecl): Use SET_DECL_ALIGN. (copy_type_enum): Use SET_TYPE_ALIGN. * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN. (tsubst): Ditto. * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN. * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN. * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN. * rtti.c (emit_tinfo_decl): Ditto. fortran/ * trans-io.c (gfc_build_io_library_fndecls): Use SET_TYPE_ALIGN. * trans-common.c (build_common_decl): Use SET_DECL_ALIGN. * trans-types.c (gfc_add_field_to_struct): Use SET_DECL_ALIGN. go/ * go-gcc.cc (Gcc_backend::implicit_variable): Use SET_DECL_ALIGN. java/ * class.c (add_method_1): Use SET_DECL_ALIGN. (make_class_data): Ditto. (emit_register_classes_in_jcr_section): Ditto. * typeck.c (build_java_array_type): Ditto. objc/ * objc-act.c (objc_build_struct): Use SET_DECL_ALIGN. libcc1/ * plugin.cc (plugin_finish_record_or_union): Use SET_TYPE_ALIGN. From-SVN: r235172
2016-02-25re PR c++/69842 (Parameter deduction in polymorphic lambdas)Jason Merrill1-17/+13
PR c++/69842 * method.c (forward_parm): Handle parameter packs. * lambda.c (maybe_add_lambda_conv_op): Use it for them. From-SVN: r233719
2016-02-17re PR c++/69842 (Parameter deduction in polymorphic lambdas)Jason Merrill1-1/+3
PR c++/69842 * method.c (forward_parm): Split out from... (add_one_base_init): ...here. * lambda.c (maybe_add_lambda_conv_op): Use it. From-SVN: r233506
2016-01-22re PR c++/69392 (G++ can't capture 'this' pointer to templated type using ↵Jason Merrill1-9/+9
init-capture) PR c++/69392 * lambda.c (lambda_capture_field_type): Handle 'this' specially for init-capture, too. From-SVN: r232746
2016-01-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2015-12-20re PR c++/67411 (internal compiler error: in tsubst_copy, at cp/pt.c:13473)Jason Merrill1-3/+11
PR c++/67411 * lambda.c (generic_lambda_fn_p): Split out from... (maybe_add_lambda_conv_op): ...here. * semantics.c (process_outer_var_ref): Don't defer maybe-constant variables in a generic lambda. * pt.c (instantiate_non_dependent_or_null): New. * init.c (constant_value_1): Use it. * cp-tree.h: Declare it and generic_lambda_fn_p. From-SVN: r231863
2015-11-25lambda.c (maybe_add_lambda_conv_op): Only set no_sanitize_undefined if ↵Jason Merrill1-5/+8
SANITIZE_NULL. * lambda.c (maybe_add_lambda_conv_op): Only set no_sanitize_undefined if SANITIZE_NULL. From-SVN: r230908
2015-11-25re PR sanitizer/67941 (calls on function pointer from a captureless lambda ↵Jason Merrill1-0/+6
cause ubsan warning) PR c++/67941 * lambda.c (maybe_add_lambda_conv_op): Mark _FUN as no_sanitize_undefined. From-SVN: r230897