1. 16 Jul, 2017 1 commit
  2. 14 Jul, 2017 1 commit
    • c/c++: Add fix-it hints for suggested missing #includes · eea77d1f
      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
  3. 13 Jul, 2017 1 commit
  4. 12 Jul, 2017 1 commit
    • cp-tree.h (DECL_CONSTRUCTOR_P, [...]): Look at identifier flags. · 3da3dcdb
      	* 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
  5. 11 Jul, 2017 2 commits
  6. 10 Jul, 2017 1 commit
  7. 06 Jul, 2017 2 commits
    • PR c++/81204 - parse error with dependent template-name · 9ddfe5f4
      	PR c++/81204 - parse error with dependent template-name
      	* parser.c (cp_parser_lookup_name): Revert previous change.
      
      From-SVN: r250037
      Jason Merrill committed
    • Support C++-specific selftests · b6f43128
      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
  8. 04 Jul, 2017 2 commits
    • parser.c (cp_parser_decomposition_declaration): Replace decomposition… · 8e3b9bbf
      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… · 9fc1fed4
      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
  9. 03 Jul, 2017 2 commits
    • re PR c++/65775 (Late-specified return type bypasses return type checks… · 17c18221
      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
    • C++: fix "RT_INTERATION" typo · 4ab42f46
      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
  10. 30 Jun, 2017 6 commits
    • PR c++/81257 - ICE with invalid ::template. · 3d4de231
      	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. · 08fb1316
      	* 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
    • Fix location of typeid() (PR c++/80014) · e59e8b5a
      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, [...]): Don't declare. · fe32bb1b
      	* 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. · 3b5c768c
      	* 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
    • re PR c++/81229 (ICE in c_tree_chain_next on aarch64) · 274c1516
      	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
  11. 29 Jun, 2017 12 commits
  12. 28 Jun, 2017 9 commits