Commit Graph

11020 Commits

Author SHA1 Message Date
Alexandre Oliva e072b0c410 [libcp1] handle anon aggregates linkage-named by typedefs
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
2017-04-15 03:28:31 +00:00
Richard Biener 350792ffae re PR target/79671 (mapnik miscompilation on armv7hl since r235622)
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
2017-04-12 07:35:49 +00:00
Jason Merrill 125db6a1c6 PR c++/80294 - ICE with constexpr and inheritance.
* 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
2017-04-11 17:07:32 -04:00
Jakub Jelinek 347e1f7769 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
2017-04-11 22:51:16 +02:00
Jakub Jelinek 82665822b1 re PR c++/80363 (#'vec_cond_expr' not supported by dump_expr#<expression error>)
PR c++/80363
	* error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.

	* g++.dg/ext/pr80363.C: New test.

From-SVN: r246834
2017-04-11 10:51:40 +02:00
Jakub Jelinek b447b28c5e re PR c++/80176 (cannot bind reference to static member function using object access expression)
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
2017-04-10 22:49:11 +02:00
Marek Polacek 98a7a34e26 re PR sanitizer/80348 (UBSAN: compile time crash in ubsan_instrument_division)
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
2017-04-10 17:18:15 +00:00
Jason Merrill 3f4334cb95 PR c++/80356 - ICE with reference to function template argument.
PR c++/79294
	* pt.c (convert_nontype_argument_function): Adjust type even with a
	value-dependent argument.

From-SVN: r246794
2017-04-09 01:38:40 -04:00
Jason Merrill c60faeee9e PR c++/80267 - ICE with nested capture of reference
PR c++/60992
	* pt.c (tsubst_copy): Handle lookup finding a capture proxy.

From-SVN: r246793
2017-04-09 01:06:08 -04:00
Marek Polacek 2166aeb3ab re PR c++/80095 (ICE with this pointer in NSDMI)
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
2017-04-07 18:09:55 +00:00
Marek Polacek 1ef532f452 re PR sanitizer/80348 (UBSAN: compile time crash in ubsan_instrument_division)
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
2017-04-07 17:51:55 +00:00
Jakub Jelinek 98568e0337 re PR c++/80309 (ICE: canonical types differ for identical types _Args2 and _Args2)
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
2017-04-05 21:10:17 +02:00
Volker Reichelt c0ea338bd2 re PR c++/80296 (Broken diagnostic 'unary_plus_expr' not supported by expression)
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
2017-04-04 16:30:44 +00:00
Jason Merrill e43073896c * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
From-SVN: r246680
2017-04-04 11:25:21 -04:00
Jonathan Wakely 5764ee3c84 Fix numerous typos in comments
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
2017-04-03 23:30:56 +01:00
Jason Merrill 5a68fae797 PR sanitizer/79993 - ICE with VLA initialization from string
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
2017-04-03 17:15:36 -04:00
Jakub Jelinek 6f3af35628 re PR sanitizer/79572 (reference binding to null pointer not reported with -fsanitize=undefined)
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
2017-03-31 20:39:25 +02:00
Jakub Jelinek af88f55707 re PR libstdc++/80251 (Is the is_aggregate meta function missing?)
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
2017-03-31 08:40:39 +02:00
Jakub Jelinek a9e4a1a56f re PR target/80162 (ICE on invalid code (address of register variable))
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
2017-03-27 23:07:21 +02:00
Jason Merrill 90471a3d83 PR c++/77339 - ICE with invalid use of alias template.
* pt.c (lookup_template_class_1): Don't try to enter the scope of an
	alias template.

From-SVN: r246462
2017-03-24 10:40:13 -04:00
Marek Polacek c8b1fbc12a re PR c++/80119 (-Wmaybe-uninitialized wrongly flags the body of a short-circuited if-clause)
PR c++/80119
	* cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
	doesn't have side effects.

	* g++.dg/warn/Wuninitialized-9.C: New test.

From-SVN: r246461
2017-03-24 14:22:01 +00:00
Jason Merrill 842562b4e1 PR c++/80150 - ICE with overloaded variadic deduction.
* pt.c (try_one_overload): Remove asserts.

From-SVN: r246422
2017-03-23 14:23:25 -04:00
Jason Merrill 16e9eaa627 PR c++/77563 - missing ambiguous conversion error.
* call.c (convert_like_real): Use LOOKUP_IMPLICIT.

From-SVN: r246417
2017-03-23 08:50:55 -04:00
Marek Polacek ee3ff3945a c-tree.h: Remove a C_RID_YYCODE reference.
* c-tree.h: Remove a C_RID_YYCODE reference.

	* cp-tree.h: Remove a C_RID_YYCODE reference.

From-SVN: r246416
2017-03-23 12:29:28 +00:00
Jakub Jelinek f13e9cd513 re PR c++/80141 (ICE with pragma omp declare)
PR c++/80141
	* semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
	case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
	processing_template_decl.

	* g++.dg/gomp/pr80141.C: New test.

From-SVN: r246403
2017-03-22 19:53:47 +01:00
Paolo Carlini d3e19c2c97 re PR c++/77752 (ICE on C++ code on x86_64-linux-gnu (internal compiler error: Segmentation fault, build_list_conv, implicit_conversion))
/cp
2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/77752
	* name-lookup.c (pushtag_1): Add check for bogus, non template,
	std::initializer_list.

/testsuite
2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/77752
	* g++.dg/cpp0x/initlist97.C: New.
	* g++.dg/cpp0x/initlist85.C: Update.

From-SVN: r246310
2017-03-21 10:18:51 +00:00
Marek Polacek 9da12bea7d Fix CL.
From-SVN: r246304
2017-03-21 07:50:14 +00:00
Jakub Jelinek 8bee092e7f re PR c++/35878 ([LWG 2302] Useless NULL pointer check when constructing object)
PR c++/35878
	* init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.

	* g++.dg/init/pr35878_1.C: Rewrite directives to scan optimized
	dump instead of assembler.
	* g++.dg/init/pr35878_2.C: Likewise.
	* g++.dg/init/pr35878_3.C: Likewise.

From-SVN: r246303
2017-03-21 08:30:48 +01:00
Ville Voutilainen ece3b7e65a re PR c++/35878 ([LWG 2302] Useless NULL pointer check when constructing object)
gcc/

PR c++/35878
* cp/init.c (std_placement_new_fn_p): New.
(build_new_1): Call it.

testsuite/

PR c++/35878
* g++.dg/init/pr35878_1.C: New.
* g++.dg/init/pr35878_2.C: Likewise.
* g++.dg/init/pr35878_3.C: Likewise.

From-SVN: r246301
2017-03-21 08:36:22 +02:00
Jason Merrill 55b11c6090 PR c++/80096 - ICE with C++17 non-type auto.
* pt.c (tsubst): Delay tsubst of type of template non-type
	parameter.

From-SVN: r246292
2017-03-20 16:36:54 -04:00
Jason Merrill 18f73c5f24 PR c++/79519 - ICE with deleted template friend.
* decl.c (grokdeclarator): Complain about misplaced function
	definition using =, as well.

From-SVN: r246291
2017-03-20 16:36:46 -04:00
Jason Merrill 8afd9c45b6 PR c++/79640 - infinite recursion with generic lambda.
* pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
	before substituting its initializer.

From-SVN: r246289
2017-03-20 14:49:10 -04:00
Marek Polacek 92377255c1 PR c++/80059 - ICE with noexcept and __transaction_atomic
PR c++/80059 - ICE with noexcept and __transaction_atomic
	* except.c (build_must_not_throw_expr): Call
	instantiate_non_dependent_expr_sfinae.

	* g++.dg/tm/pr80059-2.C: New test.
	* g++.dg/tm/pr80059.C: New test.

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>

From-SVN: r246279
2017-03-20 15:02:09 +00:00
Jason Merrill a4dfaae105 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
* decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
	reference decomposition.

From-SVN: r246273
2017-03-19 22:22:43 -04:00
Jason Merrill c881690892 PR c++/80077 - error with constexpr and -fno-elide-constructors.
* constexpr.c (cxx_eval_call_expression): Set ctx->call while
	expanding trivial constructor.

From-SVN: r246272
2017-03-19 22:22:36 -04:00
Jason Merrill d1a73b0bae PR c++/78345 - ICE initializing array from lambda.
* init.c (build_aggr_init): Check array initializer.
	(build_vec_init): Check the type of a CONSTRUCTOR.

From-SVN: r246244
2017-03-17 14:56:22 -04:00
Jason Merrill c7ec585d78 PR c++/80073 - C++17 ICE with virtual base.
* decl.c (xref_basetypes): Also check for indirect vbases.

From-SVN: r246242
2017-03-17 14:42:09 -04:00
Jason Merrill 2e92d7ada9 * decl.c (start_enum): std::byte aliases anything.
From-SVN: r246212
2017-03-16 17:16:45 -04:00
Jason Merrill fbd603c43d re PR c++/79797 (ICE with NSDMI, this pointer and constexpr)
PR c++/79797
	* constexpr.c (lookup_placeholder): Tweak.

From-SVN: r246210
2017-03-16 17:16:33 -04:00
Jason Merrill 559a77e112 PR c++/80043 - ICE with -fpermissive
* typeck.c (convert_for_assignment): Handle instantiate_type
	not giving an error.

From-SVN: r246180
2017-03-15 17:32:43 -04:00
Nathan Sidwell 9b74f93310 PR c++/79393 DR 1658 workaround
PR c++/79393 DR 1658 workaround
	* method.c (synthesized_method_base_walk): Inihibit abstract class
	virtual base access check here.
	(synthesized_method_walk): Not here.

From-SVN: r246126
2017-03-14 14:41:53 +00:00
Nathan Sidwell 16e93e4b0b PR c++/79393 DR 1658 workaround
PR c++/79393 DR 1658 workaround
	* method.c (synthesized_method_walk): Check vbases of abstract
	classes for dtor walk.

From-SVN: r246085
2017-03-13 11:58:15 +00:00
David Malcolm 2f6f187a86 Simplify uses of "%<%s%>" to "%qs" (PR translation/79848)
gcc/c-family/ChangeLog:
	PR translation/79848
	* c-format.c (check_format_string): Simplify uses of "%<%s%>" to
	"%qs".

gcc/c/ChangeLog:
	PR translation/79848
	* c-decl.c (declspecs_add_type): Simplify uses of "%<%s%>" to
	"%qs".
	* c-parser.c (c_parser_oacc_shape_clause): Likewise.

gcc/cp/ChangeLog:
	PR translation/79848
	* decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".

gcc/ChangeLog:
	PR translation/79848
	* ipa-devirt.c (warn_types_mismatch): Simplify uses of "%<%s%>" to
	"%qs".
	* ipa-pure-const.c (suggest_attribute): Likewise.  Convert _
	to G_ to avoid double translation.

From-SVN: r246068
2017-03-11 01:57:11 +00:00
Jason Merrill 0c942f3eda PR c++/79960 - alias templates and partial ordering
* pt.c (comp_template_args): Add partial_order parm.
	(template_args_equal): Likewise.
	(comp_template_args_porder): New.
	(get_partial_spec_bindings): Use it.

From-SVN: r246042
2017-03-10 12:35:54 -05:00
Marek Polacek 455d833cd8 re PR c++/79967 (ICE on non-type template argument declared noreturn)
PR c++/79967
	* decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.

	* g++.dg/cpp0x/gen-attrs-63.C: New test.

From-SVN: r246039
2017-03-10 15:36:00 +00:00
Jakub Jelinek e260b0a7dd re PR c++/79899 (ICE in ctor_omit_inherited_parms at gcc/cp/method.c:576 on ARM target)
PR c++/79899
	* optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
	Use XALLOCAVEC macro.

	* g++.dg/other/friend7.C: New test.

From-SVN: r246038
2017-03-10 16:33:04 +01:00
Jakub Jelinek cdd669f9fc re PR c++/79896 (ICE in gimplify_expr, at gimplify.c:11950 on non-int128 target)
PR c++/79896
	* decl.c (finish_enum_value_list): If value is error_mark_node,
	don't copy it and change its type.
	* init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
	of CONST_DECL is error_mark_node.

	* g++.dg/ext/int128-5.C: New test.

From-SVN: r246034
2017-03-10 16:28:26 +01:00
Marek Polacek 6443c7c0e5 re PR c++/79687 (Wrong code with pointer-to-member)
PR c++/79687
	* init.c (constant_value_1): Break if the variable has a dynamic
	initializer.

	* g++.dg/expr/ptrmem8.C: New test.
	* g++.dg/expr/ptrmem9.C: New test.

From-SVN: r246008
2017-03-09 16:36:37 +00:00
Marek Polacek 423aec8b57 PR c++/79900 - ICE in strip_typedefs
PR c++/79900 - ICE in strip_typedefs
	* tree.c (strip_typedefs): Skip the attribute handling if T is
	a variant type which hasn't been updated yet.

	* g++.dg/warn/Wpadded-1.C: New test.

From-SVN: r245988
2017-03-09 08:35:37 +00:00
Jason Merrill 89262ec6bd PR c++/79797 - ICE with self-reference in array DMI.
* constexpr.c (lookup_placeholder): Split out...
	(cxx_eval_constant_expression): ...from here.

From-SVN: r245986
2017-03-08 20:01:18 -05:00