- 16 Jul, 2017 1 commit
-
-
* parser.c (cp_parser_cast_expression): Use %q#T instead of %qT in old-style cast diagnostic. * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT in useless cast diagnostic. * error.c (type_to_string): Remove enum special handling. * g++.dg/cpp1z/direct-enum-init1.C: Revert special enum handling. * g++.dg/warn/pr12242.C: Likewise. From-SVN: r250231
Volker Reichelt committed
-
- 14 Jul, 2017 1 commit
-
-
gcc/c-family/ChangeLog: * c-common.c (try_to_locate_new_include_insertion_point): New function. (per_file_includes_t): New typedef. (added_includes_t): New typedef. (added_includes): New variable. (maybe_add_include_fixit): New function. * c-common.h (maybe_add_include_fixit): New decl. gcc/c/ChangeLog: * c-decl.c (implicitly_declare): When suggesting a missing #include, provide a fix-it hint. gcc/cp/ChangeLog: * name-lookup.c (get_std_name_hint): Add '<' and '>' around the header names. (maybe_suggest_missing_header): Update for addition of '<' and '>' to above. Provide a fix-it hint. * pt.c: Include "gcc-rich-location.h" (listify): Attempt to add fix-it hint for missing #include <initializer_list>. * rtti.c: Include "gcc-rich-location.h". (typeid_ok_p): Attempt to add fix-it hint for missing #include <typeinfo>. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/missing-initializer_list-include.C: New test case. * g++.dg/lookup/missing-std-include-2.C: New test case. * g++.dg/lookup/missing-std-include-3.C: New test case. * g++.dg/rtti/missing-typeinfo-include.C: New test case. * gcc.dg/missing-header-fixit-1.c: New test case. * gcc.dg/missing-header-fixit-2.c: New test case. * gcc.dg/missing-header-fixit-2.h: New header. From-SVN: r250203
David Malcolm committed
-
- 13 Jul, 2017 1 commit
-
-
* pt.c (do_class_deduction): Do list deduction in two phases. From-SVN: r250183
Jason Merrill committed
-
- 12 Jul, 2017 1 commit
-
-
* cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR, DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at identifier flags. * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and DECL_CXX_DESTRUCTOR explicitly. * decl2.c (grokclassfn): Likewise. * friend.c (do_friend): Likewise. * method.c (make_thunk, make_alias_for, implicitly_declare_fn): Likewise. From-SVN: r250158
Nathan Sidwell committed
-
- 11 Jul, 2017 2 commits
-
-
* decl.c (grokparms): Downgrade error about array of unknown bound to pedwarn and disable it for C++17. From-SVN: r250137
Jason Merrill committed -
From-SVN: r250130
Nathan Sidwell committed
-
- 10 Jul, 2017 1 commit
-
-
gcc/cp/ChangeLog: * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document. From-SVN: r250105
Martin Sebor committed
-
- 06 Jul, 2017 2 commits
-
-
PR c++/81204 - parse error with dependent template-name * parser.c (cp_parser_lookup_name): Revert previous change. From-SVN: r250037
Jason Merrill committed -
gcc/ChangeLog: * Makefile.in (SELFTEST_FLAGS): Drop "-x c", moving it to... (C_SELFTEST_FLAGS): New. (CPP_SELFTEST_FLAGS): New. (SELFTEST_DEPS): New, from deps of s-selftest. (C_SELFTEST_DEPS): New, from deps of s-selftest. (CPP_SELFTEST_DEPS): New. (selftest): Add dependency on s-selftest-c++. (s-selftest): Rename to... (s-selftest-c): ...this, moving deps to SELFTEST_DEPS and C_SELFTEST_DEPS, and using C_SELFTEST_FLAGS rather than SELFTEST_FLAGS. (selftest-gdb): Rename to... (selftest-c-gdb): ...this, using C_SELFTEST_DEPS and C_SELFTEST_FLAGS. (selftest-gdb): Reintroduce as an alias for selftest-c-gdb. (selftest-valgrind): Rename to... (selftest-c-valgrind): ...this, using C_SELFTEST_DEPS and C_SELFTEST_FLAGS. (selftest-valgrind): Reintroduce as an alias for selftest-c-valgrind. (s-selftest-c++): New. (selftest-c++-gdb): New. (selftest-c++-valgrind): New. gcc/c-family/ChangeLog: * c-common.c (selftest::c_family_tests): New. * c-common.h (selftest::run_c_tests): Move decl to c/c-lang.h. (selftest::c_family_tests): New decl. gcc/c/ChangeLog: * c-lang.c (selftest::run_c_tests): Move body to c_family_tests, and call that instead. * c-tree.h (selftest::run_c_tests): New decl. gcc/cp/ChangeLog: * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as selftest::run_cp_tests. (selftest::run_cp_tests): New function. * cp-tree.h (selftest::run_cp_tests): New decl. From-SVN: r250030
David Malcolm committed
-
- 04 Jul, 2017 2 commits
-
-
parser.c (cp_parser_decomposition_declaration): Replace decomposition declaration with structured binding in diagnostics. * parser.c (cp_parser_decomposition_declaration): Replace decomposition declaration with structured binding in diagnostics. * decl.c (cp_finish_decomp): Likewise. (grokdeclarator): Likewise. * g++.dg/cpp1z/decomp1.C: Expect structured binding instead of decomposition declaration in diagnostics. * g++.dg/cpp1z/decomp2.C: Likewise. * g++.dg/cpp1z/decomp3.C: Likewise. * g++.dg/cpp1z/decomp4.C: Likewise. * g++.dg/cpp1z/decomp5.C: Likewise. * g++.dg/cpp1z/decomp6.C: Likewise. * g++.dg/cpp1z/decomp7.C: Likewise. * g++.dg/cpp1z/decomp8.C: Likewise. * g++.dg/cpp1z/decomp13.C: Likewise. * g++.dg/cpp1z/decomp14.C: Likewise. * g++.dg/cpp1z/decomp18.C: Likewise. * g++.dg/cpp1z/decomp19.C: Likewise. * g++.dg/cpp1z/decomp22.C: Likewise. * g++.dg/cpp1z/decomp23.C: Likewise. * g++.dg/cpp1z/decomp24.C: Likewise. * g++.dg/cpp1z/decomp25.C: Likewise. * g++.dg/cpp1z/decomp26.C: Likewise. * g++.dg/cpp1z/decomp28.C: Likewise. From-SVN: r249948
Jakub Jelinek committed -
re PR c++/81258 (ICE on C++1z code with invalid decomposition declaration: in cp_finish_decl, at cp/decl.c:6760) PR c++/81258 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid forms of structured binding initializers. * g++.dg/cpp1z/decomp21.C (foo): Adjust expected diagnostics. * g++.dg/cpp1z/decomp30.C: New test. From-SVN: r249947
Jakub Jelinek committed
-
- 03 Jul, 2017 2 commits
-
-
re PR c++/65775 (Late-specified return type bypasses return type checks (qualified, function, array)) /cp 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/65775 * decl.c (grokdeclarator): Move checks on function return type after the splice_late_return_type call; if declspecs->locations[ds_type_spec] is UNKNOWN_LOCATION fall back to input_location. /testsuite 2017-07-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/65775 * g++.dg/cpp0x/trailing14.C: New. From-SVN: r249935
Paolo Carlini committed -
gcc/cp/ChangeLog: * parser.c (enum required_token): Fix spelling of RT_INTERATION to RT_ITERATION. (cp_parser_iteration_statement): Likewise. (cp_parser_required_error): Likewise. From-SVN: r249931
David Malcolm committed
-
- 30 Jun, 2017 6 commits
-
-
PR c++/54769 - wrong lookup of dependent template-name. * parser.c (cp_parser_template_name): Revert part of last change. From-SVN: r249855
Jason Merrill committed -
* 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
Nathan Sidwell committed -
gcc/cp/ChangeLog: PR c++/80014 * parser.c (cp_parser_postfix_expression): Construct a location for typeid expressions. gcc/testsuite/ChangeLog: PR c++/80014 * g++.dg/plugin/diagnostic-test-expressions-1.C (std::type_info): Add declaration. (test_typeid): New test function. From-SVN: r249845
David Malcolm committed -
* cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't declare. (lookup_all_conversions): Declare. * class.c (get_basefndecls): Use lookup_fnfields_slot. * decl.c (register_dtor_fn): Use lookup_fnfields_slot. * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework diagnostics. * pt.c (retrieve_specialization): Use lookup_fnfields_slot. (check_explicit_specialization): Use lookup_fnfields_slot_nolazy, lookup_all_conversions. * search.c (lookup_fnfields_1): Make static. (lookup_all_conversions): New. (class_method_index_for_fn): Delete. * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use lookup_fnfields_slot. * g++.dg/concepts/memfun-err.C: Adjust diagnostics. * g++.dg/cpp0x/decltype9.C: Likewise. * g++.dg/cpp0x/forw_enum9.C: Likewise. * g++.dg/lookup/decl1.C: Likewise. * g++.dg/lookup/extern-c-redecl.C: Likewise. * g++.dg/other/pr28432.C: Likewise. * g++.dg/parse/crash12.C: Likewise. * g++.dg/parse/enum3.C: Likewise. * g++.dg/parse/operator6.C: Likewise. * g++.dg/template/crash69.C: Likewise. * g++.dg/template/error27.C: Likewise. * g++.dg/template/error28.C: Likewise. * g++.dg/template/memfriend6.C: Likewise. * g++.old-deja/g++.mike/err1.C: Likewise. * g++.old-deja/g++.mike/p811.C: Likewise. * g++.old-deja/g++.other/crash25.C: Likewise. * g++.old-deja/g++.other/dtor4.C: Likewise. * g++.old-deja/g++.pt/t37.C: Likewise. From-SVN: r249843
Nathan Sidwell committed -
* call.c (build_new_method_call_1): Use constructo_name to get ctor name. Move argument processing earlier to merge cdtor handling blocks. * decl.c (grokfndecl): Cdtors have special names. * method.c (implicitly_declare_fn): Likewise. Simplify flag setting. * pt.c (check_explicit_specialization): Cdtor name is already special. * search.c (class_method_index_for_fn): Likewise. * g++.dg/plugin/decl-plugin-test.C: Expect special ctor name. From-SVN: r249838
Nathan Sidwell committed -
PR c++/81229 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding a matching TYPE_DECL. * g++.dg/lookup/pr81229.C: New. From-SVN: r249835
Nathan Sidwell committed
-
- 29 Jun, 2017 12 commits
-
-
/cp 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com> * class.c (add_method): Change pair of errors to error + inform. (handle_using_decl): Likewise. /testsuite 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/inh-ctor3.C: Adjust for dg-message vs dg-error. * g++.dg/diagnostic/variadic1.C: Likewise. * g++.dg/gomp/udr-3.C: Likewise. * g++.dg/overload/error1.C: Likewise. * g++.dg/overload/error2.C: Likewise. * g++.dg/template/duplicate1.C: Likewise. * g++.old-deja/g++.benjamin/warn02.C: Likewise. * g++.old-deja/g++.brendan/arm2.C: Likewise. * g++.old-deja/g++.other/redecl2.C: Likewise. * g++.old-deja/g++.other/redecl4.C: Likewise. * g++.old-deja/g++.pt/memtemp78.C: Likewise. From-SVN: r249820
Paolo Carlini committed -
From-SVN: r249818
Jason Merrill committed -
* pt.c (build_deduction_guide): Correct member template handling. From-SVN: r249816
Jason Merrill committed -
* tree.c (cp_tree_equal): Remove COMPONENT_REF special case. From-SVN: r249813
Jason Merrill committed -
re PR c++/81247 (ICE on invalid C++ code with malformed namespace declaration: in do_push_nested_namespace, at cp/name-lookup.c:6002) PR c++/81247 * parser.c (cp_parser_namespace_definition): Immediately close the namespace if there's no open-brace. * name-lookup.c (do_pushdecl): Reset OLD when pushing into new namespace. From-SVN: r249804
Nathan Sidwell committed -
* search.c (binfo_direct_p): New. * name-lookup.c (do_class_using_decl): Use it. From-SVN: r249797
Jason Merrill committed -
* cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE, VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete. * decl.c (initialize_predefined_identifiers): Name cdtor special names consistently. Use literals for above deleted defines. (cxx_init_decl_processing): Use literal for vtbl_ptr_type name, From-SVN: r249791
Nathan Sidwell committed -
* lex.c (maybe_add_lang_type_raw): Exit early, rather than use a flag. From-SVN: r249790
Nathan Sidwell committed -
* call.c (check_dtor_name): Use constructor_name for enums too. (build_new_method_call_1): Use constructor_name for cdtors and show ~ for dtor. * class.c (build_self_reference): Use TYPE_NAME to get name of self reference. * name-lookup (constructor_name): Use DECL_NAME directly. (constructor_name_p): Reimplement. (push_class_level_binding_1): Use TYPE_NAME directly. From-SVN: r249789
Nathan Sidwell committed -
* class.c (finish_struct): Use OVL_P. (get_vfield_name): Measure constructor_name length. * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK. (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front. * cxx-pretty-print.c (is_destructor_name): Delete. (pp_cxx_unqualified_id): Remove bogus destructor name checking. * decl.c (grokfndecl): Move cheap checks first when looking for implicit extern cness. From-SVN: r249788
Nathan Sidwell committed -
* parser.c (cp_parser_direct_declarator): Reorder if to avoid indentation. Remove unnecessary assignment of constructor name. From-SVN: r249787
Nathan Sidwell committed -
* call.c (name_as_c_string): Move CONST_CAST to return. (build_new_method_call_1): Remove unneeded bracing. * class.c (include_empty_classes): Unbreak line. * constraint.cc (tsubst_check_constraint): Add space. * cp-tree.h (lang_decl_ns): Add comment. (PTRMEM_CST_MEMBER): Break line. * decl.c (grokfndecl): Add blank lines. Unbreak some others. (grokdeclarator): Remove lines, move declaration to first use. * decl2.c (decl_needed_p): Fix indentation. (c_parse_final_cleanups): Remove blank line. * method.c (implicitly_declare_fn): Move declaration to first use. * search.c (current_scope): Add blank lines. From-SVN: r249786
Nathan Sidwell committed
-
- 28 Jun, 2017 9 commits
-
-
* decl.c (build_typename_type): No longer static. * tree.c (strip_typedefs): Use it instead of make_typename_type. From-SVN: r249760
Jason Merrill committed -
* pt.c (maybe_instantiate_noexcept): Check for recursion. From-SVN: r249757
Jason Merrill committed -
* pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION. From-SVN: r249756
Jason Merrill committed -
* pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS. From-SVN: r249755
Jason Merrill committed -
* parser.c (cp_parser_class_head): Handle ::template. From-SVN: r249754
Jason Merrill committed -
* pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling. From-SVN: r249753
Jason Merrill committed -
* parser.c (cp_parser_template_name): Handle dependent object type. (cp_parser_nested_name_specifier_opt): Make template_keyword_p a parameter. (cp_parser_id_expression): Pass it. (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR. From-SVN: r249752
Jason Merrill committed -
* parser.c (cp_parser_template_id): Use the range location on the TEMPLATE_ID_EXPR. From-SVN: r249751
Jason Merrill committed -
* parser.c (cp_parser_lookup_name): Disqualify function templates after lookup. From-SVN: r249750
Jason Merrill committed
-