- 27 Apr, 2017 1 commit
-
-
* parser.c (cp_parser_cast_expression): Add target type of cast to diagnostic. * error.c (type_to_string): Add '{enum}' suffix to enumeration types. * g++.dg/cpp1z/direct-enum-init1.C: Adjust for more verbose enum diagnostics. * g++.dg/warn/pr12242.C: Likewise. From-SVN: r247347
Volker Reichelt committed
-
- 26 Apr, 2017 2 commits
-
-
2017-04-26 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change return type to bool. * cp-tree.h (grok_ctor_properties): Update. From-SVN: r247286
Paolo Carlini committed -
parser.c (cp_parser_nested_name_specifier_opt): Add fix-it information to diagnostic of invalid colon in nested-name-specifier. * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it information to diagnostic of invalid colon in nested-name-specifier. * g++.dg/diagnostic/nested-name-1.C: New test. From-SVN: r247282
Volker Reichelt committed
-
- 25 Apr, 2017 4 commits
-
-
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 -
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 -
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 -
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
-
- 24 Apr, 2017 3 commits
-
-
* 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 -
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. (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
-
- 21 Apr, 2017 2 commits
-
-
* constexpr.c (verify_ctor_sanity): Handle flexible array members. From-SVN: r247067
Jason Merrill committed -
2017-04-21 Richard Biener <rguenther@suse.de> * tree.h (build_qualified_type): Annotate with CXX_MEM_STAT_INFO. (build_distinct_type_copy): Likewise. (build_variant_type_copy): Likewise. * tree.c (build_qualified_type): Pass down mem-stat info. (build_distinct_type_copy): Likewise. (build_variant_type_copy): Likewise. cp/ * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO. (copy_type): Likewise. * lex.c (copy_decl): Pass down mem-stat info. (copy_type): Likewise. From-SVN: r247053
Richard Biener committed
-
- 20 Apr, 2017 3 commits
-
-
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. * 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 -
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
-
- 18 Apr, 2017 2 commits
-
-
* error.c (dump_expr): Handle TREE_LIST. * parser.c (cp_parser_std_attribute_list): Return error_mark if make_pack_expansion returns an error. * g++.dg/cpp0x/alignas11.C: New test. From-SVN: r246963
Marek Polacek committed -
* tree.c (strip_typedefs): Handle UNDERLYING_TYPE. * g++.dg/cpp0x/alias-decl-59.C: New test. From-SVN: r246962
Marek Polacek committed
-
- 17 Apr, 2017 3 commits
-
-
PR c++/80287 * class.c (fixup_may_alias): Fix all type variants. gcc/testsuite 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/80287 * g++.dg/lto/pr80287_0.C: New test. From-SVN: r246955
Bernd Edlinger committed -
* tree.c (lvalue_kind): Return clk_class for an array prvalue. From-SVN: r246954
Jason Merrill committed -
From-SVN: r246953
Jason Merrill committed
-
- 15 Apr, 2017 1 commit
-
-
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
-
- 12 Apr, 2017 1 commit
-
-
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 Apr, 2017 3 commits
-
-
* constexpr.c (reduced_constant_expression_p): A null constructor element is non-constant. (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before returning an empty base. From-SVN: r246858
Jason Merrill committed -
re PR c++/80370 (ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)) PR c++/80370 * decl.c (cp_finish_decomp): If processing_template_decl on non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst processing. * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type dependent. * g++.dg/cpp1z/decomp28.C: New test. From-SVN: r246857
Jakub Jelinek committed -
PR c++/80363 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR. * g++.dg/ext/pr80363.C: New test. From-SVN: r246834
Jakub Jelinek committed
-
- 10 Apr, 2017 2 commits
-
-
PR c++/80176 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second operand, if it is a static member function, recurse on the BASELINK. * g++.dg/init/ref23.C: New test. From-SVN: r246825
Jakub Jelinek committed -
PR sanitizer/80348 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set ORIG_TYPE earlier and not only when shortening. * g++.dg/ubsan/div-by-zero-3.C: New test. From-SVN: r246812
Marek Polacek committed
-
- 09 Apr, 2017 2 commits
-
-
PR c++/79294 * pt.c (convert_nontype_argument_function): Adjust type even with a value-dependent argument. From-SVN: r246794
Jason Merrill committed -
PR c++/60992 * pt.c (tsubst_copy): Handle lookup finding a capture proxy. From-SVN: r246793
Jason Merrill committed
-
- 07 Apr, 2017 2 commits
-
-
PR c++/80095 * call.c (build_over_call): Don't check cxx_dialect. * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor whether SUB is a CONSTRUCTOR. * init.c (build_new_1): Don't check cxx_dialect. * tree.c (replace_placeholders): Add a function comment. Return if not in C++14, or if the object isn't a (member of a) class. * typeck2.c (store_init_value): Don't check cxx_dialect nor whether TYPE is CLASS_TYPE_P. * g++.dg/cpp1y/nsdmi-aggr8.C: New test. From-SVN: r246772
Marek Polacek committed -
PR sanitizer/80348 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE. * g++.dg/ubsan/div-by-zero-2.C: New test. From-SVN: r246770
Marek Polacek committed
-
- 05 Apr, 2017 1 commit
-
-
PR c++/80309 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead of a loop doing vec_safe_push of NULL. Formatting fixes. (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx to newidx before calling canonical_type_parameter on newtype. From-SVN: r246717
Jakub Jelinek committed
-
- 04 Apr, 2017 2 commits
-
-
PR c++/80296 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add UNARY_PLUS_EXPR case. * g++.dg/cpp0x/alias-decl-80296.C: New test. From-SVN: r246683
Volker Reichelt committed -
From-SVN: r246680
Jason Merrill committed
-
- 03 Apr, 2017 2 commits
-
-
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 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
-
- 31 Mar, 2017 2 commits
-
-
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 -
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
-
- 27 Mar, 2017 1 commit
-
-
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
-
- 24 Mar, 2017 1 commit
-
-
* pt.c (lookup_template_class_1): Don't try to enter the scope of an alias template. From-SVN: r246462
Jason Merrill committed
-