1. 27 Apr, 2017 1 commit
  2. 26 Apr, 2017 2 commits
  3. 25 Apr, 2017 4 commits
    • parser.c (cp_parser_elaborated_type_specifier): Add fix-it to diagnostic of… · 70caf430
      parser.c (cp_parser_elaborated_type_specifier): Add fix-it to diagnostic of invalid class/struct keyword after enum.
      
              * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
              diagnostic of invalid class/struct keyword after enum.
      
              * g++.dg/cpp0x/enum34.C: New test.
      
      From-SVN: r247254
      Volker Reichelt committed
    • C++: fix-it hint for removing stray semicolons · fbe91804
      gcc/cp/ChangeLog:
      	* parser.c (cp_parser_member_declaration): Add fix-it hint
      	for removing stray semicolons.
      
      gcc/testsuite/ChangeLog:
      	* g++.dg/semicolon-fixits.C: New test case.
      
      From-SVN: r247244
      David Malcolm committed
    • C++: hints for missing std:: headers · 5ca28c1d
      gcc/cp/ChangeLog:
      	* name-lookup.c (get_std_name_hint): New function.
      	(maybe_suggest_missing_header): New function.
      	(suggest_alternative_in_explicit_scope): Call
      	maybe_suggest_missing_header.
      
      gcc/testsuite/ChangeLog:
      	* g++.dg/lookup/missing-std-include.C: New test file.
      
      From-SVN: r247240
      David Malcolm committed
    • Fix spelling suggestions for reserved words (PR c++/80177) · 7d5dbb22
      gcc/cp/ChangeLog:
      	PR c++/80177
      	* name-lookup.c (suggest_alternative_in_explicit_scope): Convert
      	candidate type of bm from tree to const char *.
      	(consider_binding_level): Likewise.
      	(lookup_name_fuzzy): Likewise, using this to merge the best
      	result from the preprocessor into bm, rather than immediately
      	returning, so that better matches from reserved words can "win".
      	Guard the rejection of keywords that don't start decl-specifiers
      	so it only happens for FUZZY_LOOKUP_TYPENAME.
      
      gcc/testsuite/ChangeLog:
      	PR c++/80177
      	* g++.dg/spellcheck-pr80177.C: New test case.
      
      From-SVN: r247233
      David Malcolm committed
  4. 24 Apr, 2017 3 commits
    • decl.c (grokdeclarator): Use %qT instead of %<%T%> in · 761ad35c
              * decl.c (grokdeclarator): Use %qT instead of %<%T%> in
              * diagnostics.
              (start_enum): Likewise.
              (build_enumerator): Likewise. Use %qE instead of plain %E.
              * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
              %<%D%> in diagnostics.
              (cp_parser_elaborated_type_specifier): Likewise.
              * pt.c (make_pack_expansion): Use %qT and %qE instead of
              %<%T%> and %<%E%> in diagnostics.
              (tsubst_pack_expansion): Likewise.
      
      From-SVN: r247110
      Volker Reichelt committed
    • Fix location of sizeof/alignof (PR c++/80016) · 412f61f0
      PR c++/80016 reports an issue with bizarre underlined range
      for a complicated expression.
      
      The root cause for the incorrect *starting* location of that range
      is that alignof and sizeof expressions currently have
      start == finish == caret at the opening parenthesis of the
      expression.
      
      This patch fixes this by generating appropriate start and finish
      locations for alignof and sizeof expressions.
      
      gcc/cp/ChangeLog:
      	PR c++/80016
      	* parser.c (cp_parser_unary_expression):  Generate a location
      	range for alignof and sizeof expressions.
      
      gcc/testsuite/ChangeLog:
      	PR c++/80016
      	* g++.dg/plugin/diagnostic-test-expressions-1.C (test_sizeof): New
      	test function.
      	(test_alignof): New test function.
      
      From-SVN: r247108
      David Malcolm committed
    • parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to error message. · ec856f5f
              * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
              error message.
              (cp_parser_virt_specifier_seq_opt): Likewise.
              (set_and_check_decl_spec_loc): Likewise twice.
      
              * g++.dg/diagnostic/duplicate1.C: New test.
              * g++.dg/cpp0x/duplicate1.C: New test.
      
      From-SVN: r247105
      Volker Reichelt committed
  5. 21 Apr, 2017 2 commits
  6. 20 Apr, 2017 3 commits
    • PR c++/80473 allow suppressing notes about over-aligned new · 34d57a10
      gcc/cp:
      
      	PR c++/80473
      	* init.c (build_new_1): Suppress notes about over-aligned new when
      	the warning is suppressed.
      
      gcc/testsuite:
      
      	PR c++/80473
      	* g++.dg/diagnostic/pr80473.C: New test.
      
      From-SVN: r247033
      Jonathan Wakely committed
    • c.opt (Wextra-semi): New C++ warning flag. · c3cbcd45
              * c.opt (Wextra-semi): New C++ warning flag.
              * doc/invoke.texi (-Wextra-semi): Document new warning option.
              * parser.c (cp_parser_member_declaration): Add warning with fixit
              information for extra semicolon after in-class function definition.
              * g++.dg/warn/Wextra-semi.C: New test.
      
      From-SVN: r247028
      Volker Reichelt committed
    • re PR middle-end/80423 (GC related -fcompare-debug failure) · 8a59d466
      	PR middle-end/80423
      	* tree.h (build_array_type): Add typeless_storage default argument.
      	* tree.c (type_cache_hasher::equal): Also compare
      	TYPE_TYPELESS_STORAGE flag for ARRAY_TYPEs.
      	(build_array_type): Add typeless_storage argument, set
      	TYPE_TYPELESS_STORAGE to it, if shared also hash it, and pass to
      	recursive call.
      	(build_nonshared_array_type): Adjust build_array_type_1 caller.
      	(build_array_type): Likewise.  Add typeless_storage argument.
      c-family/
      	* c-common.c (complete_array_type): Preserve TYPE_TYPELESS_STORAGE.
      cp/
      	* tree.c (build_cplus_array_type): Call build_array_type
      	with the intended TYPE_TYPELESS_STORAGE flag value, instead
      	of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
      	on the shared type.
      testsuite/
      	* g++.dg/other/pr80423.C: New test.
      
      From-SVN: r247014
      Jakub Jelinek committed
  7. 18 Apr, 2017 2 commits
  8. 17 Apr, 2017 3 commits
  9. 15 Apr, 2017 1 commit
    • [libcp1] handle anon aggregates linkage-named by typedefs · e072b0c4
      Arrange for the first typedef to an anonymous type in the same context
      to be used as the linkage name for the type.
      
      for  gcc/cp/ChangeLog
      
      	* decl.c (name_unnamed_type): Split out of...
      	(grokdeclarator): ... this.
      	* decl.h (name_unnamed_type): Declare.
      
      for  libcc1/ChangeLog
      
      	* libcp1plugin.cc (plugin_build_decl): Call name_unnamed_type.
      
      From-SVN: r246938
      Alexandre Oliva committed
  10. 12 Apr, 2017 1 commit
    • re PR target/79671 (mapnik miscompilation on armv7hl since r235622) · 350792ff
      2017-04-12  Richard Biener  <rguenther@suse.de>
      	Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
      	PR middle-end/79671
      	* alias.c (component_uses_parent_alias_set_from): Handle
      	TYPE_TYPELESS_STORAGE.
      	(get_alias_set): Likewise.
      	* tree-core.h (tree_type_common): Add typeless_storage flag.
      	* tree.h (TYPE_TYPELESS_STORAGE): New macro.
      	* stor-layout.c (place_union_field): Set TYPE_TYPELESS_STORAGE
      	for types containing members with TYPE_TYPELESS_STORAGE.
      	(place_field): Likewise.
      	(layout_type): Likewise for ARRAY_TYPE.
      	* lto-streamer-out.c (hash_tree): Hash TYPE_TYPELESS_STORAGE.
      	* tree-streamer-in.c (unpack_ts_type_common_value_fields): Stream
      	TYPE_TYPELESS_STORAGE.
      	* tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise.
      
      	lto/
      	* lto.c (compare_tree_sccs_1): Compare TYPE_TYPELESS_STORAGE.
      
      	cp/
      	* tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
      	for arrays of character or std::byte type.
      
      	* g++.dg/torture/pr79671.C: New testcase.
      	* g++.dg/lto/pr79671_0.C: Likewise.
      	* g++.dg/lto/pr79671_1.c: Likewise.
      
      Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
      
      From-SVN: r246866
      Richard Biener committed
  11. 11 Apr, 2017 3 commits
  12. 10 Apr, 2017 2 commits
  13. 09 Apr, 2017 2 commits
  14. 07 Apr, 2017 2 commits
  15. 05 Apr, 2017 1 commit
  16. 04 Apr, 2017 2 commits
  17. 03 Apr, 2017 2 commits
    • Fix numerous typos in comments · 5764ee3c
      gcc:
      
      	* alias.c (base_alias_check): Fix typo in comment.
      	* cgraph.h (class ipa_polymorphic_call_context): Likewise.
      	* cgraphunit.c (symbol_table::compile): Likewise.
      	* collect2.c (maybe_run_lto_and_relink): Likewise.
      	* config/arm/arm.c (arm_thumb1_mi_thunk): Likewise.
      	* config/avr/avr-arch.h (avr_arch_info_t): Likewise.
      	* config/avr/avr.c (avr_map_op_t): Likewise.
      	* config/cr16/cr16.h (DATA_ALIGNMENT): Likewise.
      	* config/epiphany/epiphany.c (TARGET_ARG_PARTIAL_BYTES): Likewise.
      	* config/epiphany/epiphany.md (movcc): Likewise.
      	* config/i386/i386.c (legitimize_pe_coff_extern_decl): Likewise.
      	* config/m68k/m68k.c (struct _sched_ib, m68k_sched_variable_issue):
      	Likewise.
      	* config/mips/mips.c (mips_save_restore_reg): Likewise.
      	* config/rx/rx.c (rx_is_restricted_memory_address): Likewise.
      	* config/s390/s390.c (Z10_EARLYLOAD_DISTANCE): Likewise.
      	* config/sh/sh.c (sh_rtx_costs): Likewise.
      	* fold-const.c (fold_truth_andor): Likewise.
      	* genautomata.c (collapse_flag): Likewise.
      	* gengtype.h (struct type::u::s): Likewise.
      	* gensupport.c (has_subst_attribute, add_mnemonic_string): Likewise.
      	* input.c (FORMAT_AMOUNT): Likewise.
      	* ipa-cp.c (class ipcp_lattice, agg_replacements_to_vector)
      	(known_aggs_to_agg_replacement_list): Likewise.
      	* ipa-inline-analysis.c: Likewise.
      	* ipa-inline.h (estimate_edge_time, estimate_edge_hints): Likewise.
      	* ipa-polymorphic-call.c
      	(ipa_polymorphic_call_context::restrict_to_inner_class): Likewise.
      	* loop-unroll.c (analyze_insn_to_expand_var): Likewise.
      	* lra.c (lra_optional_reload_pseudos, lra_subreg_reload_pseudos):
      	Likewise.
      	* modulo-sched.c (apply_reg_moves): Likewise.
      	* omp-expand.c (build_omp_regions_1): Likewise.
      	* trans-mem.c (struct tm_wrapper_hasher): Likewise.
      	* tree-ssa-loop-ivopts.c (may_eliminate_iv): Likewise.
      	* tree-ssa-loop-niter.c (maybe_lower_iteration_bound): Likewise.
      	* tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
      	* value-prof.c: Likewise.
      	* var-tracking.c (val_reset): Likewise.
      
      gcc/ada:
      
      	* doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
      	* g-socket.adb (To_Host_Entry): Fix typo in comment.
      	* gnat_ugn.texi: Fix typo.
      	* raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
      	* s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
      	* sem_ch3.adb (Build_Derived_Record_Type): Likewise.
      	* sem_util.adb (Mark_Coextensions): Likewise.
      	* sem_util.ads (Available_Full_View_Of_Component): Likewise.
      
      gcc/c:
      
      	* c-array-notation.c: Fix typo in comment.
      
      gcc/c-family:
      
      	* c-warn.c (do_warn_double_promotion): Fix typo in comment.
      
      gcc/cp:
      
              * class.c (update_vtable_entry_for_fn): Fix typo in comment.
      	* decl2.c (one_static_initialization_or_destruction): Likewise.
      	* name-lookup.c (store_bindings): Likewise.
      	* parser.c (make_call_declarator): Likewise.
      	* pt.c (check_explicit_specialization): Likewise.
      
      gcc/testsuite:
      
      	* g++.old-deja/g++.benjamin/scope02.C: Fix typo in comment.
      	* gcc.dg/20031012-1.c: Likewise.
      	* gcc.dg/ipa/ipcp-1.c: Likewise.
      	* gcc.dg/torture/matrix-3.c: Likewise.
      	* gcc.target/powerpc/ppc-spe.c: Likewise.
      	* gcc.target/rx/zero-width-bitfield.c: Likewise.
      
      libcpp:
      
      	* include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
      	* lex.c (search_line_fast): Likewise.
      	* pch.h (cpp_valid_state): Likewise.
      
      libdecnumber:
      
      	* decCommon.c (decFloatFromPackedChecked): Fix typo in comment.
      	* decNumber.c (decNumberPower, decMultiplyOp): Likewise.
      
      libgcc:
      
      	* config/c6x/pr-support.c (__gnu_unwind_execute): Fix typo in comment.
      
      libitm:
      
      	* libitm_i.h (sutrct gtm_thread): Fix typo in comment.
      
      From-SVN: r246664
      Jonathan Wakely committed
    • PR sanitizer/79993 - ICE with VLA initialization from string · 5a68fae7
      	PR c++/69487 - wrong VLA initialization from string
      	* init.c (finish_length_check): Split out from build_vec_init.
      	(build_vec_init): Handle STRING_CST.
      	* typeck2.c (split_nonconstant_init): Handle STRING_CST.
      	(digest_init_r): Don't give a STRING_CST VLA type.
      
      From-SVN: r246662
      Jason Merrill committed
  18. 31 Mar, 2017 2 commits
    • re PR sanitizer/79572 (reference binding to null pointer not reported with -fsanitize=undefined) · 6f3af356
      	PR c++/79572
      	* c-ubsan.h (ubsan_maybe_instrument_reference): Change argument to
      	tree *.
      	* c-ubsan.c (ubsan_maybe_instrument_reference): Likewise.  Handle
      	not just NOP_EXPR to REFERENCE_TYPE, but also INTEGER_CST with
      	REFERENCE_TYPE.
      
      	* cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
      	REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
      	for NOP_EXPR to REFERENCE_TYPE.
      
      	* g++.dg/ubsan/null-8.C: New test.
      
      From-SVN: r246621
      Jakub Jelinek committed
    • re PR libstdc++/80251 (Is the is_aggregate meta function missing?) · af88f557
      	PR libstdc++/80251
      c-family/
      	* c-common.h (enum rid): Add RID_IS_AGGREGATE.
      	* c-common.c (c_common_reswords): Add __is_aggregate trait.
      cp/
      	* cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
      	* cxx-pretty-print.c (pp_cxx_trait_expression): Handle
      	CPTK_IS_AGGREGATE.
      	* semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
      	Remove extraneous parens.
      	(finish_trait_expr): Handle CPTK_IS_AGGREGATE.
      	* parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
      	(cp_parser_trait_expr): Likewise.
      testsuite/
      	* g++.dg/ext/is_aggregate.C: New test.
      
      From-SVN: r246609
      Jakub Jelinek committed
  19. 27 Mar, 2017 1 commit
    • re PR target/80162 (ICE on invalid code (address of register variable)) · a9e4a1a5
      	PR middle-end/80162
      c-family/
      	* c-common.c (c_common_mark_addressable_vec): Don't set
      	TREE_ADDRESSABLE on DECL_HARD_REGISTER.
      c/
      	* c-tree.h (c_mark_addressable): Add array_ref_p argument.
      	* c-typeck.c (c_mark_addressable): Likewise.  Look through
      	VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
      	to ARRAY_TYPE.
      	(build_array_ref): Pass true as array_ref_p to c_mark_addressable.
      cp/
      	* cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
      	* typeck.c (cxx_mark_addressable): Likewise.  Look through
      	VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
      	to ARRAY_TYPE.
      	(cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
      testsuite/
      	* c-c++-common/pr80162-1.c: New test.
      	* c-c++-common/pr80162-2.c: New test.
      	* c-c++-common/pr80162-3.c: New test.
      
      From-SVN: r246512
      Jakub Jelinek committed
  20. 24 Mar, 2017 1 commit