diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-09-15 18:15:46 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-09-15 18:15:46 +0200 |
commit | 7b9361409dda228eedb13a3abe547c3cafbe957b (patch) | |
tree | ab528462949004d5d5871813f8f16e42bae6dd2b /gcc/cp | |
parent | a1189286e5dedc4ab4aacda95216b047017cd3cf (diff) | |
download | gcc-7b9361409dda228eedb13a3abe547c3cafbe957b.zip gcc-7b9361409dda228eedb13a3abe547c3cafbe957b.tar.gz gcc-7b9361409dda228eedb13a3abe547c3cafbe957b.tar.bz2 |
invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and 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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 39 | ||||
-rw-r--r-- | gcc/cp/Make-lang.in | 9 | ||||
-rw-r--r-- | gcc/cp/call.c | 6 | ||||
-rw-r--r-- | gcc/cp/class.c | 8 | ||||
-rw-r--r-- | gcc/cp/constexpr.c | 2 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 37 | ||||
-rw-r--r-- | gcc/cp/lambda.c | 2 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 8 | ||||
-rw-r--r-- | gcc/cp/parser.c | 80 | ||||
-rw-r--r-- | gcc/cp/pt.c | 16 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 4 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 4 |
13 files changed, 128 insertions, 89 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1bda581..0a3b80f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,42 @@ +2017-09-15 Jakub Jelinek <jakub@redhat.com> + + * 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. + 2017-09-14 Jakub Jelinek <jakub@redhat.com> PR c++/81314 diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index f860645..24e9d7c 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -169,13 +169,14 @@ c++.srcman: doc/g++.1 # entry point. We feed the former to the latter here. check-c++ : check-g++ -# Run the testsuite in C++1z mode. -check-c++1z: - $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS)" GXX_TESTSUITE_STDS=1z check-g++ +# Run the testsuite in C++17 mode. +check-c++1z: check-c++17 +check-c++17: + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS)" GXX_TESTSUITE_STDS=17 check-g++ # Run the testsuite in all standard conformance levels. check-c++-all: - $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --stds=98,11,14,1z,concepts" check-g++ + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --stds=98,11,14,17,concepts" check-g++ # Run the testsuite with garbage collection at every opportunity. check-g++-strict-gc: diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 88af0d3..4fa0d03 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3743,7 +3743,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags, /* FIXME P0135 doesn't say what to do in C++17 about list-initialization from a single element. For now, let's handle constructors as before and also consider conversion operators from the element. */ - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 && BRACE_ENCLOSED_INITIALIZER_P (expr) && CONSTRUCTOR_NELTS (expr) == 1) fromtype = TREE_TYPE (CONSTRUCTOR_ELT (expr, 0)->value); @@ -8035,7 +8035,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) /* In C++17 we shouldn't be copying a TARGET_EXPR except into a base subobject. */ - if (CHECKING_P && cxx_dialect >= cxx1z) + if (CHECKING_P && cxx_dialect >= cxx17) gcc_assert (TREE_CODE (arg) != TARGET_EXPR /* It's from binding the ref parm to a packed field. */ || convs[0]->need_temporary_p @@ -8792,7 +8792,7 @@ build_special_member_call (tree instance, tree name, vec<tree, va_gc> **args, of the destination, the initializer expression is used to initialize the destination object." Handle that here to avoid doing overload resolution. */ - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 && args && vec_safe_length (*args) == 1 && name == complete_ctor_identifier) { diff --git a/gcc/cp/class.c b/gcc/cp/class.c index cd63c21..97e29c0 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -4317,7 +4317,7 @@ build_base_field (record_layout_info rli, tree binfo, back end issues with overlapping FIELD_DECLs, but that doesn't seem to be a problem anymore. We need them to handle initialization of C++17 aggregate bases. */ - if (cxx_dialect >= cxx1z && !BINFO_VIRTUAL_P (binfo)) + if (cxx_dialect >= cxx17 && !BINFO_VIRTUAL_P (binfo)) { tree decl = build_base_field_1 (t, basetype, next_field); DECL_FIELD_OFFSET (decl) = BINFO_OFFSET (binfo); @@ -5351,7 +5351,7 @@ finalize_literal_type_property (tree t) || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)) CLASSTYPE_LITERAL_P (t) = false; else if (CLASSTYPE_LITERAL_P (t) && LAMBDA_TYPE_P (t)) - CLASSTYPE_LITERAL_P (t) = (cxx_dialect >= cxx1z); + CLASSTYPE_LITERAL_P (t) = (cxx_dialect >= cxx17); else if (CLASSTYPE_LITERAL_P (t) && !TYPE_HAS_TRIVIAL_DFLT (t) && CLASSTYPE_NON_AGGREGATE (t) && !TYPE_HAS_CONSTEXPR_CTOR (t)) @@ -5394,9 +5394,9 @@ explain_non_literal_class (tree t) return; inform (0, "%q+T is not literal because:", t); - if (cxx_dialect < cxx1z && LAMBDA_TYPE_P (t)) + if (cxx_dialect < cxx17 && LAMBDA_TYPE_P (t)) inform (0, " %qT is a closure type, which is only literal in " - "C++1z and later", t); + "C++17 and later", t); else if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)) inform (0, " %q+T has a non-trivial destructor", t); else if (CLASSTYPE_NON_AGGREGATE (t) diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 2d2f3b8..a89ee49 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -3304,7 +3304,7 @@ var_in_constexpr_fn (tree t) bool var_in_maybe_constexpr_fn (tree t) { - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 && DECL_FUNCTION_SCOPE_P (t) && LAMBDA_FUNCTION_P (DECL_CONTEXT (t))) return true; diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f4d6f80..e508598 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3884,7 +3884,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter) declared with constexpr specifier are implicitly inline variables. */ #define DECL_INLINE_VAR_P(NODE) \ (DECL_VAR_DECLARED_INLINE_P (NODE) \ - || (cxx_dialect >= cxx1z \ + || (cxx_dialect >= cxx17 \ && DECL_DECLARED_CONSTEXPR_P (NODE) \ && DECL_CLASS_SCOPE_P (NODE))) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 6101bdf..858747e 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2909,7 +2909,7 @@ redeclaration_error_message (tree newdecl, tree olddecl) if the variable is defined within the class with constexpr specifier is declaration rather than definition (and deprecated). */ - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 && DECL_CLASS_SCOPE_P (olddecl) && DECL_DECLARED_CONSTEXPR_P (olddecl) && !DECL_INITIAL (newdecl)) @@ -4050,7 +4050,7 @@ cxx_init_decl_processing (void) std_node = current_namespace; pop_namespace (); - flag_noexcept_type = (cxx_dialect >= cxx1z); + flag_noexcept_type = (cxx_dialect >= cxx17); c_common_nodes_and_builtins (); @@ -4150,7 +4150,7 @@ cxx_init_decl_processing (void) aligned_new_threshold = 1; } if (aligned_new_threshold == -1) - aligned_new_threshold = (cxx_dialect >= cxx1z) ? 1 : 0; + aligned_new_threshold = (cxx_dialect >= cxx17) ? 1 : 0; if (aligned_new_threshold == 1) aligned_new_threshold = malloc_alignment () / BITS_PER_UNIT; @@ -5573,7 +5573,7 @@ next_initializable_field (tree field) && (TREE_CODE (field) != FIELD_DECL || (DECL_C_BIT_FIELD (field) && !DECL_NAME (field)) || (DECL_ARTIFICIAL (field) - && !(cxx_dialect >= cxx1z && DECL_FIELD_IS_BASE (field))))) + && !(cxx_dialect >= cxx17 && DECL_FIELD_IS_BASE (field))))) field = DECL_CHAIN (field); return field; @@ -5585,7 +5585,7 @@ next_initializable_field (tree field) bool is_direct_enum_init (tree type, tree init) { - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 && TREE_CODE (type) == ENUMERAL_TYPE && ENUM_FIXED_UNDERLYING_TYPE_P (type) && TREE_CODE (init) == CONSTRUCTOR @@ -6351,7 +6351,7 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups) if (cxx_dialect < cxx11) error ("initializer invalid for static member with constructor"); - else if (cxx_dialect < cxx1z) + else if (cxx_dialect < cxx17) error ("non-constant in-class initialization invalid for static " "member %qD", decl); else @@ -6727,9 +6727,9 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p, or local register variable extension. */ if (VAR_P (decl) && DECL_REGISTER (decl) && asmspec_tree == NULL_TREE) { - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) pedwarn (DECL_SOURCE_LOCATION (decl), OPT_Wregister, - "ISO C++1z does not allow %<register%> storage " + "ISO C++17 does not allow %<register%> storage " "class specifier"); else warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wregister, @@ -9787,10 +9787,10 @@ mark_inline_variable (tree decl) "%qD declared at block scope", decl); inlinep = false; } - else if (cxx_dialect < cxx1z) + else if (cxx_dialect < cxx17) pedwarn (DECL_SOURCE_LOCATION (decl), 0, "inline variables are only available " - "with -std=c++1z or -std=gnu++1z"); + "with -std=c++17 or -std=gnu++17"); if (inlinep) { retrofit_lang_decl (decl); @@ -10522,7 +10522,7 @@ grokdeclarator (const cp_declarator *declarator, /* We might have ignored or rejected some of the qualifiers. */ type_quals = cp_type_quals (type); - if (cxx_dialect >= cxx1z && type && is_auto (type) + if (cxx_dialect >= cxx17 && type && is_auto (type) && innermost_code != cdk_function && id_declarator && declarator != id_declarator) if (tree tmpl = CLASS_PLACEHOLDER_TEMPLATE (type)) @@ -11730,7 +11730,7 @@ grokdeclarator (const cp_declarator *declarator, error ("cannot use %<::%> in parameter declaration"); if (type_uses_auto (type) - && !(cxx_dialect >= cxx1z && template_parm_flag)) + && !(cxx_dialect >= cxx17 && template_parm_flag)) { if (cxx_dialect >= cxx14) error ("%<auto%> parameter not permitted in this context"); @@ -12063,7 +12063,7 @@ grokdeclarator (const cp_declarator *declarator, mark_inline_variable (decl); if (!DECL_VAR_DECLARED_INLINE_P (decl) - && !(cxx_dialect >= cxx1z && constexpr_p)) + && !(cxx_dialect >= cxx17 && constexpr_p)) /* Even if there is an in-class initialization, DECL is considered undefined until an out-of-class definition is provided, unless this is an inline @@ -12332,9 +12332,9 @@ grokdeclarator (const cp_declarator *declarator, /* Warn about register storage specifiers on PARM_DECLs. */ if (TREE_CODE (decl) == PARM_DECL) { - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) pedwarn (DECL_SOURCE_LOCATION (decl), OPT_Wregister, - "ISO C++1z does not allow %<register%> storage " + "ISO C++17 does not allow %<register%> storage " "class specifier"); else warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wregister, @@ -12601,8 +12601,7 @@ grokparms (tree parmlist, tree *parms) } else if (abstract_virtuals_error (decl, type)) any_error = 1; /* Seems like a good idea. */ - else if (cxx_dialect < cxx1z - && POINTER_TYPE_P (type)) + else if (cxx_dialect < cxx17 && POINTER_TYPE_P (type)) { /* Before C++17 DR 393: [dcl.fct]/6, parameter types cannot contain pointers @@ -13803,7 +13802,7 @@ xref_basetypes (tree ref, tree base_list) /* Before C++17, an aggregate cannot have base classes. In C++17, an aggregate can't have virtual, private, or protected base classes. */ - if (cxx_dialect < cxx1z + if (cxx_dialect < cxx17 || access != access_public_node || via_virtual) CLASSTYPE_NON_AGGREGATE (ref) = true; @@ -15574,7 +15573,7 @@ finish_function (int flags) check_function_concept (fndecl); /* Lambda closure members are implicitly constexpr if possible. */ - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 && LAMBDA_TYPE_P (CP_DECL_CONTEXT (fndecl))) DECL_DECLARED_CONSTEXPR_P (fndecl) = ((processing_template_decl diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 9ba3df1..e441256 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -155,7 +155,7 @@ begin_lambda_type (tree lambda) /* In C++17, assume the closure is literal; we'll clear the flag later if necessary. */ - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) CLASSTYPE_LITERAL_P (type) = true; /* Clear base types. */ diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 15f4421..33cd00e 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -116,7 +116,7 @@ struct GTY(()) globals { bool need_abi_warning; /* True if the mangling will be different in C++17 mode. */ - bool need_cxx1z_warning; + bool need_cxx17_warning; }; static GTY (()) globals G; @@ -362,7 +362,7 @@ write_exception_spec (tree spec) if (!flag_noexcept_type) { - G.need_cxx1z_warning = true; + G.need_cxx17_warning = true; return; } @@ -3666,7 +3666,7 @@ start_mangling (const tree entity) { G.entity = entity; G.need_abi_warning = false; - G.need_cxx1z_warning = false; + G.need_cxx17_warning = false; obstack_free (&name_obstack, name_base); mangle_obstack = &name_obstack; name_base = obstack_alloc (&name_obstack, 0); @@ -3853,7 +3853,7 @@ mangle_decl (const tree decl) } SET_DECL_ASSEMBLER_NAME (decl, id); - if (G.need_cxx1z_warning + if (G.need_cxx17_warning && (TREE_PUBLIC (decl) || DECL_REALLY_EXTERN (decl))) warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wnoexcept_type, "mangled name for %qD will change in C++17 because the " diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 4bfae36..c9cb3cb 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -3163,9 +3163,9 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree id, error_at (location, "invalid use of template-name %qE without an argument list", decl); - if (DECL_CLASS_TEMPLATE_P (decl) && cxx_dialect < cxx1z) + if (DECL_CLASS_TEMPLATE_P (decl) && cxx_dialect < cxx17) inform (location, "class template argument deduction is only available " - "with -std=c++1z or -std=gnu++1z"); + "with -std=c++17 or -std=gnu++17"); inform (DECL_SOURCE_LOCATION (decl), "%qD declared here", decl); } else if (TREE_CODE (id) == BIT_NOT_EXPR) @@ -5034,10 +5034,10 @@ cp_parser_primary_expression (cp_parser *parser, { expr = cp_parser_fold_expression (parser, expr); if (expr != error_mark_node - && cxx_dialect < cxx1z + && cxx_dialect < cxx17 && !in_system_header_at (input_location)) pedwarn (input_location, 0, "fold-expressions only available " - "with -std=c++1z or -std=gnu++1z"); + "with -std=c++17 or -std=gnu++17"); } else /* Let the front end know that this expression was @@ -10200,9 +10200,9 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr) && cp_lexer_nth_token_is_keyword (parser->lexer, 2, RID_THIS)) { location_t loc = cp_lexer_peek_token (parser->lexer)->location; - if (cxx_dialect < cxx1z) + if (cxx_dialect < cxx17) pedwarn (loc, 0, "%<*this%> capture only available with " - "-std=c++1z or -std=gnu++1z"); + "-std=c++17 or -std=gnu++17"); cp_lexer_consume_token (parser->lexer); cp_lexer_consume_token (parser->lexer); add_capture (lambda_expr, @@ -10474,12 +10474,12 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr) if (lambda_specs.locations[ds_constexpr]) { - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) return_type_specs.locations[ds_constexpr] = lambda_specs.locations[ds_constexpr]; else error_at (lambda_specs.locations[ds_constexpr], "%<constexpr%> " - "lambda only available with -std=c++1z or -std=gnu++1z"); + "lambda only available with -std=c++17 or -std=gnu++17"); } p = obstack_alloc (&declarator_obstack, 0); @@ -11284,9 +11284,9 @@ cp_parser_selection_statement (cp_parser* parser, bool *if_p, { cx = true; cp_token *tok = cp_lexer_consume_token (parser->lexer); - if (cxx_dialect < cxx1z && !in_system_header_at (tok->location)) + if (cxx_dialect < cxx17 && !in_system_header_at (tok->location)) pedwarn (tok->location, 0, "%<if constexpr%> only available " - "with -std=c++1z or -std=gnu++1z"); + "with -std=c++17 or -std=gnu++17"); } /* Look for the `('. */ @@ -11310,10 +11310,10 @@ cp_parser_selection_statement (cp_parser* parser, bool *if_p, if (cp_parser_init_statement_p (parser)) { tree decl; - if (cxx_dialect < cxx1z) + if (cxx_dialect < cxx17) pedwarn (cp_lexer_peek_token (parser->lexer)->location, 0, "init-statement in selection statements only available " - "with -std=c++1z or -std=gnu++1z"); + "with -std=c++17 or -std=gnu++17"); cp_parser_init_statement (parser, &decl); } @@ -11884,7 +11884,7 @@ cp_convert_range_for (tree statement, tree range_decl, tree range_expr, /*is_constant_init*/false, NULL_TREE, LOOKUP_ONLYCONVERTING); - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) iter_type = cv_unqualified (TREE_TYPE (end_expr)); end = build_decl (input_location, VAR_DECL, get_identifier ("__for_end"), iter_type); @@ -12024,7 +12024,7 @@ cp_parser_perform_range_for_lookup (tree range, tree *begin, tree *end) be the same, as required by the multiple auto declaration. */ if (!same_type_p (iter_type, cv_unqualified (TREE_TYPE (*end)))) { - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 && (build_x_binary_op (input_location, NE_EXPR, *begin, ERROR_MARK, *end, ERROR_MARK, @@ -13178,9 +13178,9 @@ cp_parser_decomposition_declaration (cp_parser *parser, } } - if (cxx_dialect < cxx1z) + if (cxx_dialect < cxx17) pedwarn (loc, 0, "structured bindings only available with " - "-std=c++1z or -std=gnu++1z"); + "-std=c++17 or -std=gnu++17"); tree pushed_scope; cp_declarator *declarator = make_declarator (cdk_decomp); @@ -13771,7 +13771,7 @@ cp_parser_linkage_specification (cp_parser* parser) static_assert-declaration: static_assert ( constant-expression , string-literal ) ; - static_assert ( constant-expression ) ; (C++1Z) + static_assert ( constant-expression ) ; (C++17) If MEMBER_P, this static_assert is a class member. */ @@ -13812,10 +13812,10 @@ cp_parser_static_assert(cp_parser *parser, bool member_p) if (cp_lexer_peek_token (parser->lexer)->type == CPP_CLOSE_PAREN) { - if (cxx_dialect < cxx1z) + if (cxx_dialect < cxx17) pedwarn (input_location, OPT_Wpedantic, "static_assert without a message " - "only available with -std=c++1z or -std=gnu++1z"); + "only available with -std=c++17 or -std=gnu++17"); /* Eat the ')' */ cp_lexer_consume_token (parser->lexer); message = build_string (1, ""); @@ -17040,7 +17040,7 @@ cp_parser_simple_type_specifier (cp_parser* parser, /* Don't gobble tokens or issue error messages if this is an optional type-specifier. */ - if ((flags & CP_PARSER_FLAGS_OPTIONAL) || cxx_dialect >= cxx1z) + if ((flags & CP_PARSER_FLAGS_OPTIONAL) || cxx_dialect >= cxx17) cp_parser_parse_tentatively (parser); token = cp_lexer_peek_token (parser->lexer); @@ -17088,10 +17088,10 @@ cp_parser_simple_type_specifier (cp_parser* parser, && identifier_p (DECL_NAME (type))) maybe_note_name_used_in_class (DECL_NAME (type), type); /* If it didn't work out, we don't have a TYPE. */ - if (((flags & CP_PARSER_FLAGS_OPTIONAL) || cxx_dialect >= cxx1z) + if (((flags & CP_PARSER_FLAGS_OPTIONAL) || cxx_dialect >= cxx17) && !cp_parser_parse_definitely (parser)) type = NULL_TREE; - if (!type && cxx_dialect >= cxx1z) + if (!type && cxx_dialect >= cxx17) { if (flags & CP_PARSER_FLAGS_OPTIONAL) cp_parser_parse_tentatively (parser); @@ -18425,10 +18425,10 @@ cp_parser_namespace_definition (cp_parser* parser) if (cp_lexer_next_token_is_not (parser->lexer, CPP_SCOPE)) break; - if (!nested_definition_count && cxx_dialect < cxx1z) + if (!nested_definition_count && cxx_dialect < cxx17) pedwarn (input_location, OPT_Wpedantic, "nested namespace definitions only available with " - "-std=c++1z or -std=gnu++1z"); + "-std=c++17 or -std=gnu++17"); /* Nested namespace names can create new namespaces (unlike other qualified-ids). */ @@ -18657,11 +18657,11 @@ cp_parser_using_declaration (cp_parser* parser, else if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS)) { cp_token *ell = cp_lexer_consume_token (parser->lexer); - if (cxx_dialect < cxx1z + if (cxx_dialect < cxx17 && !in_system_header_at (ell->location)) pedwarn (ell->location, 0, "pack expansion in using-declaration only available " - "with -std=c++1z or -std=gnu++1z"); + "with -std=c++17 or -std=gnu++17"); qscope = make_pack_expansion (qscope); } @@ -18720,10 +18720,10 @@ cp_parser_using_declaration (cp_parser* parser, && cp_lexer_next_token_is (parser->lexer, CPP_COMMA)) { cp_token *comma = cp_lexer_consume_token (parser->lexer); - if (cxx_dialect < cxx1z) + if (cxx_dialect < cxx17) pedwarn (comma->location, 0, "comma-separated list in using-declaration only available " - "with -std=c++1z or -std=gnu++1z"); + "with -std=c++17 or -std=gnu++17"); goto again; } @@ -19317,7 +19317,7 @@ cp_parser_init_declarator (cp_parser* parser, /* Handle C++17 deduction guides. */ if (!decl_specifiers->type && ctor_dtor_or_conv_p <= 0 - && cxx_dialect >= cxx1z) + && cxx_dialect >= cxx17) { cp_declarator *id = get_id_declarator (declarator); tree name = id->u.id.unqualified_name; @@ -23085,12 +23085,12 @@ cp_parser_type_parameter_key (cp_parser* parser) if ((tag_type = cp_parser_token_is_type_parameter_key (token)) != none_type) { cp_lexer_consume_token (parser->lexer); - if (pedantic && tag_type == typename_type && cxx_dialect < cxx1z) + if (pedantic && tag_type == typename_type && cxx_dialect < cxx17) /* typename is not allowed in a template template parameter - by the standard until C++1Z. */ + by the standard until C++17. */ pedwarn (token->location, OPT_Wpedantic, "ISO C++ forbids typename key in template template parameter;" - " use -std=c++1z or -std=gnu++1z"); + " use -std=c++17 or -std=gnu++17"); } else cp_parser_error (parser, "expected %<class%> or %<typename%>"); @@ -24122,9 +24122,9 @@ cp_parser_exception_specification_opt (cp_parser* parser) /* Restore the saved message. */ parser->type_definition_forbidden_message = saved_message; - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) { - error_at (loc, "ISO C++1z does not allow dynamic exception " + error_at (loc, "ISO C++17 does not allow dynamic exception " "specifications"); type_id_list = NULL_TREE; } @@ -24136,7 +24136,7 @@ cp_parser_exception_specification_opt (cp_parser* parser) /* In C++17, throw() is equivalent to noexcept (true). throw() is deprecated in C++11 and above as well, but is still widely used, so don't warn about it yet. */ - else if (cxx_dialect >= cxx1z) + else if (cxx_dialect >= cxx17) type_id_list = noexcept_true_spec; else type_id_list = empty_except_spec; @@ -25133,11 +25133,11 @@ cp_parser_std_attribute_spec (cp_parser *parser) if (attr_ns && cp_lexer_nth_token_is (parser->lexer, 3, CPP_COLON)) { - if (cxx_dialect < cxx1z + if (cxx_dialect < cxx17 && !in_system_header_at (input_location)) pedwarn (input_location, 0, "attribute using prefix only available " - "with -std=c++1z or -std=gnu++1z"); + "with -std=c++17 or -std=gnu++17"); cp_lexer_consume_token (parser->lexer); cp_lexer_consume_token (parser->lexer); @@ -26197,7 +26197,7 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p) nested-name-specifier. Except in C++17 mode, where we might be declaring a guiding declaration. */ if (!nested_name_specifier && outside_class_specifier_p - && cxx_dialect < cxx1z) + && cxx_dialect < cxx17) constructor_p = false; else if (nested_name_specifier == error_mark_node) constructor_p = false; @@ -26228,7 +26228,7 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p) }; we must recognize that the nested `S' names a class. */ - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) cp_parser_parse_tentatively (parser); tree type_decl; @@ -26240,7 +26240,7 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p) /*class_head_p=*/false, /*is_declaration=*/false); - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 && !cp_parser_parse_definitely (parser)) { type_decl = NULL_TREE; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ec7bbc8..f12ab26 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4551,7 +4551,7 @@ mark_template_parm (tree t, void* data) } /* In C++17 the type of a non-type argument is a deduced context. */ - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 && TREE_CODE (t) == TEMPLATE_PARM_INDEX) for_each_template_parm (TREE_TYPE (t), &mark_template_parm, @@ -6475,7 +6475,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain) to leave it in that form rather than lower it to a CONSTRUCTOR. */; else if (INTEGRAL_OR_ENUMERATION_TYPE_P (type) - || cxx_dialect >= cxx1z) + || cxx_dialect >= cxx17) { /* C++17: A template-argument for a non-type template-parameter shall be a converted constant expression (8.20) of the type of the @@ -6663,7 +6663,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain) orig_expr, type, decl); return NULL_TREE; } - else if ((cxx_dialect >= cxx11 && cxx_dialect < cxx1z) + else if ((cxx_dialect >= cxx11 && cxx_dialect < cxx17) && decl_linkage (decl) == lk_none) { if (complain & tf_error) @@ -10817,7 +10817,7 @@ instantiate_class_template_1 (tree type) tree decl = lambda_function (type); if (decl) { - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) CLASSTYPE_LITERAL_P (type) = true; if (!DECL_TEMPLATE_INFO (decl) @@ -19543,7 +19543,7 @@ type_unification_real (tree tparms, tsubst_flags_t complain = (explain_p ? tf_warning_or_error : tf_none); - bool tried_array_deduction = (cxx_dialect < cxx1z); + bool tried_array_deduction = (cxx_dialect < cxx17); for (i = 0; i < ntparms; i++) { @@ -20918,7 +20918,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict, else if (uses_template_parms (tparm)) { /* We haven't deduced the type of this parameter yet. */ - if (cxx_dialect >= cxx1z + if (cxx_dialect >= cxx17 /* We deduce from array bounds in try_array_deduction. */ && !(strict & UNIFY_ALLOW_INTEGER)) { @@ -21890,7 +21890,7 @@ get_partial_spec_bindings (tree tmpl, tree spec_tmpl, tree args) else deduced_args = innermost_deduced_args; - bool tried_array_deduction = (cxx_dialect < cxx1z); + bool tried_array_deduction = (cxx_dialect < cxx17); again: if (unify (tparms, deduced_args, INNERMOST_TEMPLATE_ARGS (spec_args), @@ -23707,7 +23707,7 @@ dependent_type_p_r (tree type) arg_type = TREE_CHAIN (arg_type)) if (dependent_type_p (TREE_VALUE (arg_type))) return true; - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) { /* A value-dependent noexcept-specifier makes the type dependent. */ tree spec = TYPE_RAISES_EXCEPTIONS (type); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 0a09998..aa5d128 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6177,11 +6177,11 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, } else { - if (cxx_dialect >= cxx1z) + if (cxx_dialect >= cxx17) { if (complain & tf_error) error ("use of an operand of type %qT in " - "%<operator++%> is forbidden in C++1z", + "%<operator++%> is forbidden in C++17", boolean_type_node); return error_mark_node; } diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index e9aca39..82e18ec 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1364,7 +1364,7 @@ process_init_constructor_record (tree type, tree init, gcc_assert (TREE_CODE (type) == RECORD_TYPE); gcc_assert (!CLASSTYPE_VBASECLASSES (type)); gcc_assert (!TYPE_BINFO (type) - || cxx_dialect >= cxx1z + || cxx_dialect >= cxx17 || !BINFO_N_BASE_BINFOS (TYPE_BINFO (type))); gcc_assert (!TYPE_POLYMORPHIC_P (type)); @@ -1384,7 +1384,7 @@ process_init_constructor_record (tree type, tree init, if (TREE_CODE (field) != FIELD_DECL || (DECL_ARTIFICIAL (field) - && !(cxx_dialect >= cxx1z && DECL_FIELD_IS_BASE (field)))) + && !(cxx_dialect >= cxx17 && DECL_FIELD_IS_BASE (field)))) continue; /* If this is a bitfield, first convert to the declared type. */ |