Commit Graph

2558 Commits

Author SHA1 Message Date
Michael Matz fe37c7afd1 tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount.
* tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount.
	(SET_TYPE_ALIGN, SET_DECL_ALIGN): New.
	* tree-core.h (tree_type_common.align): Use bit-field.
	(tree_type_common.spare): New.
	(tree_decl_common.off_align): Make smaller.
	(tree_decl_common.align): Use bit-field.

	* expr.c (expand_expr_addr_expr_1): Use SET_TYPE_ALIGN.
	* omp-low.c (install_var_field): Use SET_DECL_ALIGN.
	(scan_sharing_clauses): Ditto.
	(finish_taskreg_scan): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
	(omp_finish_file): Ditto.
	* stor-layout.c (do_type_align): Use SET_DECL_ALIGN.
	(layout_decl): Ditto.
	(relayout_decl): Ditto.
	(finalize_record_size): Use SET_TYPE_ALIGN.
	(finalize_type_size): Ditto.
	(finish_builtin_struct): Ditto.
	(layout_type): Ditto.
	(initialize_sizetypes): Ditto.
	* targhooks.c (std_gimplify_va_arg_expr): Use SET_TYPE_ALIGN.
	* tree-nested.c (insert_field_into_struct): Use SET_TYPE_ALIGN.
	(lookup_field_for_decl): Use SET_DECL_ALIGN.
	(get_chain_field): Ditto.
	(get_trampoline_type): Ditto.
	(get_nl_goto_field): Ditto.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use
	SET_DECL_ALIGN.
	(unpack_ts_type_common_value_fields): Use SET_TYPE_ALIGN.
	* gimple-expr.c (copy_var_decl): Use SET_DECL_ALIGN.
	* tree.c (make_node_stat): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
	(build_qualified_type): Use SET_TYPE_ALIGN.
	(build_aligned_type, build_range_type_1): Ditto.
	(build_atomic_base): Ditto.
	(build_common_tree_nodes): Ditto.
	* cfgexpand.c (align_local_variable): Use SET_DECL_ALIGN.
	(expand_one_stack_var_at): Ditto.
	* coverage.c (build_var): Use SET_DECL_ALIGN.
	* except.c (init_eh): Ditto.
	* function.c (assign_parm_setup_block): Ditto.
	* symtab.c (increase_alignment_1): Ditto.
	* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Ditto.
	* tree-vect-stmts.c (ensure_base_align): Ditto.
	* varasm.c (align_variable): Ditto.
	(assemble_variable): Ditto.
	(build_constant_desc): Ditto.
	(output_constant_def_contents): Ditto.

	* config/arm/arm.c (arm_relayout_function): Use SET_DECL_ALIGN.
	* config/avr/avr.c (avr_adjust_type_node): Use SET_TYPE_ALIGN.
	* config/mips/mips.c (mips_std_gimplify_va_arg_expr): Ditto.
	* config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Ditto.
	* config/spu/spu.c (spu_build_builtin_va_list): Use SET_DECL_ALIGN.

ada/
	* gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN.
	(gnat_to_gnu_field): Ditto.
	(components_to_record): Ditto.
	(create_variant_part_from): Ditto.
	(copy_and_substitute_in_size): Ditto.
	(substitute_in_type): Ditto.
	* gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN.
	(make_packable_type): Ditto.
	(maybe_pad_type): Ditto.
	(finish_fat_pointer_type): Ditto.
	(finish_record_type): Ditto and use SET_DECL_ALIGN.
	(rest_of_record_type_compilation): Use SET_TYPE_ALIGN.
	(create_field_decl): Use SET_DECL_ALIGN.

c-family/
	* c-common.c (handle_aligned_attribute): Use SET_TYPE_ALIGN
	and SET_DECL_ALIGN.

c/
	* c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
	(grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN.

cp/
	* class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
	(layout_class_type): Ditto.
	(build_base_field): Use SET_DECL_ALIGN.
	(fixup_attribute_variants): Use SET_TYPE_ALIGN.
	* decl.c (duplicate_decls): Use SET_DECL_ALIGN.
	(record_unknown_type): Use SET_TYPE_ALIGN.
	(cxx_init_decl_processing): Ditto.
	(copy_type_enum): Ditto.
	(grokfndecl): Use SET_DECL_ALIGN.
	(copy_type_enum): Use SET_TYPE_ALIGN.
	* pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
	(tsubst): Ditto.
	* tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
	* lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
	* method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
	* rtti.c (emit_tinfo_decl): Ditto.

fortran/
	* trans-io.c (gfc_build_io_library_fndecls): Use SET_TYPE_ALIGN.
	* trans-common.c (build_common_decl): Use SET_DECL_ALIGN.
	* trans-types.c (gfc_add_field_to_struct): Use SET_DECL_ALIGN.

go/
	* go-gcc.cc (Gcc_backend::implicit_variable): Use SET_DECL_ALIGN.

java/
	* class.c (add_method_1): Use SET_DECL_ALIGN.
	(make_class_data): Ditto.
	(emit_register_classes_in_jcr_section): Ditto.
	* typeck.c (build_java_array_type): Ditto.

objc/
	* objc-act.c (objc_build_struct): Use SET_DECL_ALIGN.

libcc1/
	* plugin.cc (plugin_finish_record_or_union): Use SET_TYPE_ALIGN.

From-SVN: r235172
2016-04-18 20:36:27 +00:00
Jason Merrill 8e718ecbb0 re PR c++/70494 (Internal Compiler Error: Capturing an array of vectors in a lambda)
PR c++/70494

	* decl.c (cxx_maybe_build_cleanup): Handle non-decls.
	* typeck2.c (split_nonconstant_init_1): Use it.

From-SVN: r235003
2016-04-15 00:02:49 -04:00
Martin Sebor d8747845fd PR c++/70652 - [6 Regression] r234966 causes bootstrap to fail
PR c++/70652 - [6 Regression] r234966 causes bootstrap to fail
  Revert patch for c++/69517, c++/70019, and c++/70588.

From-SVN: r234981
2016-04-14 11:35:23 -06:00
Jason Merrill 9f285ccb77 Revert empty class parameter passing ABI changes.
From-SVN: r234977
2016-04-14 12:23:06 -04:00
Martin Sebor 342fac9537 PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
PR c++/70019 - VLA size overflow not detected
PR c++/70588 - SIGBUS on a VLA larger than SIZE_MAX / 2

gcc/testsuite/ChangeLog:
2016-04-13  Martin Sebor  <msebor@redhat.com>

        PR c++/69517
        PR c++/70019
        PR c++/70588
        * c-c++-common/ubsan/vla-1.c (main): Catch exceptions.
        * g++.dg/cpp1y/vla11.C: New test.
        * g++.dg/cpp1y/vla12.C: New test.
        * g++.dg/cpp1y/vla13.C: New test.
        * g++.dg/cpp1y/vla14.C: New test.
        * g++.dg/cpp1y/vla3.C: Restore deleted test.
        * gcc/testsuite/g++.dg/init/array24.C: Fully brace VLA initializer.
        * g++.dg/ubsan/vla-1.C: Disable exceptions.

gcc/cp/ChangeLog:
2016-04-13  Martin Sebor  <msebor@redhat.com>

        PR c++/69517
        PR c++/70019
        PR c++/70588
        * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
        functions.
        * decl.c (check_initializer, cp_finish_decl): Call them.
        (reshape_init_r): Reject incompletely braced intializer-lists
        for VLAs.
        * init.c (throw_bad_array_length, build_vla_check)
        (build_vla_size_check, build_vla_init_check): Define new functions.
        * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
        to detect a VLA.
        (store_init_value): Same.

gcc/doc/ChangeLog:
2016-04-13  Martin Sebor  <msebor@redhat.com>

        PR c++/69517
        PR c++/70019
        PR c++/70588
        * extend.texi (Variable Length): Document C++ specifics.

libstdc++-v3/ChangeLog:
2016-04-13  Martin Sebor  <msebor@redhat.com>

        PR c++/69517
        * testsuite/25_algorithms/rotate/moveable2.cc: Make sure VLA
       upper bound is positive.

From-SVN: r234966
2016-04-13 17:26:41 -06:00
Jason Merrill 2ee35bea2e Warn about empty parameter ABI with -Wabi=9.
* call.c (empty_class_msg, mark_for_abi_warning)
	(warn_empty_class_abi): New.
	(build_call_a): Use them.
	* decl.c (store_parm_decls): Use mark_for_abi_warning.
	* error.c (pp_format_to_string): New.

From-SVN: r234960
2016-04-13 16:11:29 -04:00
Jason Merrill 5655267ca1 Pass empty class parameters like C.
* call.c (pass_as_empty_struct, empty_class_arg): New.
	(type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
	(build_call_a): Use empty_class_arg.
	* cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
	* decl.c (cxx_init_decl_processing): Create empty_struct_type.

From-SVN: r234959
2016-04-13 16:11:20 -04:00
Jason Merrill 0d9cdbdd7a re PR c++/70627 (internal compiler error: verify_type failed)
PR c++/70627

	* decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.

From-SVN: r234956
2016-04-13 14:32:11 -04:00
Jakub Jelinek 3eddc1c971 re PR c++/70594 (-fcompare-debug failure)
PR c++/70594
	* decl.c (pop_labels_1): Removed.
	(note_label, sort_labels): New functions.
	(pop_labels): During named_labels traversal, just push the slot
	pointers into a vector, then qsort it by DECL_UID and only then
	call pop_label and chain it into BLOCK_VARS.

From-SVN: r234942
2016-04-13 16:45:46 +02:00
Nathan Sidwell f9bf89bb6a re PR c++/68475 (ICE: in merge_exception_specifiers, at cp/typeck2.c:2115 with -fno-exceptions on invalid code)
PR c++/68475
	* decl.c (check_redeclaration_exception_specification): Check
	regardless of -fno-exceptions.
	* typeck2.c (merge_exception_specifiers): Relax assert by checking
	flag_exceptions too.

	* g++.dg/g++.dg/cpp0x/noexcept29.C: New.

From-SVN: r234667
2016-04-01 12:10:17 +00:00
Nathan Sidwell 8f80cbdb26 decl.c (start_preparsed_function): Remove unnecessary bracing.
* decl.c (start_preparsed_function): Remove unnecessary bracing.
	(finish_destructor_body): Don't emit operator delete here.

From-SVN: r234640
2016-03-31 16:18:27 +00:00
Marek Polacek 5fde6a45eb re PR c/70297 (GCC Segfaults when using -g3)
PR c/70297
	* c-decl.c (merge_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.

	* decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.

	* c-c++-common/pr70297.c: New test.
	* g++.dg/cpp0x/typedef-redecl.C: New test.
	* gcc.dg/typedef-redecl2.c: New test.

From-SVN: r234626
2016-03-31 14:29:15 +00:00
Jason Merrill e0bffbbb59 re PR c++/70353 (ICE on __PRETTY_FUNCTION__ in a constexpr function)
PR c++/70353

gcc/
	* tree-inline.c (remap_decls): Don't add_local_decl if
	cfun is null.
gcc/cp/
	* decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
	in constexpr functions.

From-SVN: r234530
2016-03-29 14:40:02 -04:00
Jason Merrill bfec0b4d57 re PR bootstrap/70422 (Bootstrap comparison failure)
PR c++/70422

	PR c++/64266
	PR c++/70353
	* decl.c, pt.c, constexpr.c: Revert last patch.

From-SVN: r234511
2016-03-28 16:16:21 -04:00
Jason Merrill d7796e23a4 re PR c++/64266 (Can GCC produce local mergeable symbols for *.__FUNCTION__ and *.__PRETTY_FUNCTION__ functions?)
PR c++/64266
	PR c++/70353
	Core issue 1962
	* decl.c (cp_fname_init): Decay the initializer to pointer.
	(cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
	DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
	Don't call cp_finish_decl.
	* pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
	DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
	* constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
	Handle DECL_VALUE_EXPR.

Co-Authored-By: Martin Liska <mliska@suse.cz>

From-SVN: r234484
2016-03-25 17:29:26 -04:00
Alexandre Oliva 05aca4e73c re PR c++/69315 (ICE in finish_function with constexpr and templates)
PR c++/69315
	* cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
	* decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
	(finish_function): Don't set or test them.
	* decl2.c (mark_used): Don't handle defer_mark_used_calls.

	* g++.dg/cpp0x/constexpr-69315.C: New test.
	* g++.dg/cpp0x/variadic122.C: Change one dg-warning into dg-bogus.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
Co-Authored-By: Jason Merrill <jason@redhat.com>

From-SVN: r234436
2016-03-23 19:36:25 +01:00
Richard Henderson ad77920598 re PR middle-end/70273 (FAIL: g++.dg/ext/label13a.C -std=gnu++98 execution test / scan-assembler _ZN1CC4Ev)
PR c++/70273

  * decl.c (notice_forced_label_r): New.
  (cp_finish_decl): Use it.

From-SVN: r234386
2016-03-21 16:03:56 -07:00
Jason Merrill bf08acdaa5 Avoid clobbering primary virtual base when not in charge.
* decl.c (build_clobber_this): Factor out of
	start_preparsed_function and begin_destructor_body.  Handle
	virtual bases better.

From-SVN: r234334
2016-03-18 11:31:29 -04:00
Jakub Jelinek a3aad0e69c re PR c++/70272 (-flifetime-dse miscompilation starting with r217967)
PR c++/70272
	* decl.c (begin_destructor_body): Don't insert clobber if
	is_empty_class (current_class_type).

	* g++.dg/opt/flifetime-dse5.C (main): Remove extra semicolon.
	* g++.dg/opt/flifetime-dse6.C: New test.
	* g++.dg/tree-ssa/ehcleanup-1.C: Adjust unreachable count.

From-SVN: r234296
2016-03-17 16:56:19 +01:00
Jason Merrill c5e003cfe4 re PR c++/70259 (-flifetime-dse=2 bug with empty bases)
PR c++/70259
	* decl.c (start_preparsed_function): Don't clobber an empty base.

From-SVN: r234267
2016-03-16 15:37:22 -04:00
Jakub Jelinek 56aae4b7c0 ipa-polymorphic-call.c (walk_ssa_copies): Fix spelling - becuase -> because.
* ipa-polymorphic-call.c (walk_ssa_copies): Fix spelling
	- becuase -> because.
	* ipa-reference.c (ignore_module_statics): Likewise.
	* cgraph.c (cgraph_node::get_body): Likewise.
	* ipa-inline.c (early_inliner): Likewise.
	* ipa-devirt.c (types_same_for_odr): Likewise.
	* tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise.
	* config/i386/i386.h (ACCUMULATE_OUTGOING_ARGS): Likewise.
cp/
	* decl.c (duplicate_decls): Fix spelling - becuase -> because.
lto/
	* lto-symtab.h (lto_symtab_prevail_decl): Fix spelling
	- becuase -> because.

From-SVN: r234061
2016-03-08 18:49:34 +01:00
Jakub Jelinek 411d61c4af decl.c (start_preparsed_function): Don't emit start clobber at the start of constructor clones.
* decl.c (start_preparsed_function): Don't emit start clobber at the
	start of constructor clones.

From-SVN: r233985
2016-03-04 23:11:41 +01:00
Jakub Jelinek 0c8825de94 re PR c++/70035 (Calling a non-virtual member in base-class constructor call with ubsan causes segfault when superclass has virtual member with same name)
PR c++/70035
	* cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
	* decl.c (start_preparsed_function): Call
	cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
	* cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
	cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.

	* g++.dg/ubsan/pr70035.C: New test.

From-SVN: r233984
2016-03-04 23:10:49 +01:00
Jason Merrill 944e9f5fee PR c++/69323 - errors
* friend.c (make_friend_class): Likewise.
	* decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.

From-SVN: r233682
2016-02-24 14:56:09 -05:00
Jason Merrill a021961c05 Add -flifetime-dse=1.
gcc/
	* common.opt (flifetime-dse): Add -flifetime-dse=1.
gcc/cp/
	* decl.c (start_preparsed_function): Condition ctor clobber on
	flag_lifetime_dse > 1.

From-SVN: r233672
2016-02-24 10:18:04 -05:00
Jakub Jelinek 9c58255170 cgraph.c: Spelling fixes - behaviour -> behavior and neighbour -> neighbor.
* cgraph.c: Spelling fixes - behaviour -> behavior and
	neighbour -> neighbor.
	* target.def: Likewise.
	* sel-sched.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/arc/arc.md: Likewise.
	* config/arm/cortex-a57.md: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/neon.md: Likewise.
	* config/arm/arm-c.c: Likewise.
	* config/vms/vms-c.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/i386/znver1.md: Likewise.
	* config/i386/i386.c: Likewise.
	* config/ia64/hpux-unix2003.h: Likewise.
	* config/msp430/msp430.md: Likewise.
	* config/rx/rx.c: Likewise.
	* config/rx/rx.md: Likewise.
	* config/aarch64/aarch64-simd.md: Likewise.
	* config/aarch64/aarch64.c: Likewise.
	* config/nvptx/nvptx.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/cris/cris.opt: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* target.h: Likewise.
	* spellcheck.c: Likewise.
	* ira-build.c: Likewise.
	* tree-inline.c: Likewise.
	* builtins.c: Likewise.
	* lra-constraints.c: Likewise.
	* explow.c: Likewise.
	* hwint.h: Likewise.
	* targhooks.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* expr.c: Likewise.
	* doc/tm.texi: Likewise.
	* doc/extend.texi: Likewise.
	* doc/install.texi: Likewise.
	* doc/md.texi: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* sched-int.h: Likewise.
	* match.pd: Likewise.
	* sched-ebb.c: Likewise.
	* target.def (omit_struct_return_reg): Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	(find_implicit_erroneous_behaviour): Renamed to...
	(find_implicit_erroneous_behavior): ... this.
	(find_explicit_erroneous_behaviour): Renamed to...
	(find_explicit_erroneous_behavior): ... this.
	(gimple_ssa_isolate_erroneous_paths): Adjust caller.
gcc/cp/
	* error.c: Spelling fixes - behaviour -> behavior and
	neighbour -> neighbor.
	* decl.c: Likewise.
	* typeck.c (cp_build_binary_op): Fix up behavior spelling in
	diagnostics.
	* init.c (build_delete): Likewise.
gcc/objc/
	* objc-act.c: Spelling fixes - behaviour -> behavior and
	neighbour -> neighbor.
	* objc-map.h: Likewise.
gcc/go/
	* gofrontend/lex.cc: Spelling fixes - behaviour -> behavior and
	neighbour -> neighbor.
	* gccgo.texi: Likewise.
gcc/ada/
	* prj-tree.ads: Spelling fixes - behaviour -> behavior and
	neighbour -> neighbor.
	* prep.adb: Likewise.
	* prj.ads: Likewise.
	* prepcomp.adb: Likewise.
	* g-socket.ads: Likewise.
	* s-imgrea.adb: Likewise.
	* a-calend.adb: Likewise.
	* exp_disp.adb: Likewise.
	* doc/gnat_ugn/gnat_utility_programs.rst: Likewise.
	* g-socket.adb: Likewise.
	* sem_ch12.adb: Likewise.
	* terminals.c: Likewise.
gcc/testsuite/
	* objc.dg/gnu-api-2-method.m: Spelling fixes - behaviour -> behavior
	and neighbour -> neighbor.
	* objc.dg/attributes/method-nonnull-1.m: Likewise.
	* objc.dg/gnu-api-2-class-meta.m: Likewise.
	* c-c++-common/Wvarargs.c: Likewise.
	* c-c++-common/goacc/host_data-5.c: Likewise.
	* obj-c++.dg/gnu-api-2-class-meta.mm: Likewise.
	* obj-c++.dg/attributes/method-nonnull-1.mm: Likewise.
	* obj-c++.dg/gnu-api-2-method.mm: Likewise.
	* gcc.target/aarch64/pr60697.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vldX_lane.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vqshl.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vshuffle.inc: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vrshl.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vldX_dup.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vstX_lane.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vqrshl.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vldX.c: Likewise.
	* gcc.target/aarch64/aapcs64/ice_2.c: Likewise.
	* gcc.target/aarch64/aapcs64/test_23.c: Likewise.
	* gcc.target/aarch64/vrnd_f64_1.c: Likewise.
	* g++.dg/warn/Wconversion-real-integer-3.C: Likewise.
	* g++.dg/lookup/koenig5.C: Likewise.
	* g++.dg/ext/no-asm-2.C: Likewise.
	* gfortran.dg/bounds_check_array_ctor_3.f90: Likewise.
	* gfortran.dg/bounds_check_array_ctor_7.f90: Likewise.
	* gfortran.dg/used_types_16.f90: Likewise.
	* gfortran.dg/assumed_rank_bounds_1.f90: Likewise.
	* gfortran.dg/bounds_check_array_ctor_1.f90: Likewise.
	* gfortran.dg/assumed_rank_bounds_2.f90: Likewise.
	* gfortran.dg/bounds_check_array_ctor_4.f90: Likewise.
	* gfortran.dg/abstract_type_6.f03: Likewise.
	* gfortran.dg/bounds_check_array_ctor_5.f90: Likewise.
	* gfortran.dg/used_types_15.f90: Likewise.
	* gfortran.dg/bounds_check_array_ctor_8.f90: Likewise.
	* gfortran.dg/exit_3.f08: Likewise.
	* gfortran.dg/open_status_2.f90: Likewise.
	* gfortran.dg/derived_pointer_recursion_2.f90: Likewise.
	* gfortran.dg/intrinsic_std_1.f90: Likewise.
	* gfortran.dg/associate_1.f03: Likewise.
	* gfortran.dg/bounds_check_array_ctor_2.f90: Likewise.
	* gfortran.dg/intrinsic_std_6.f90: Likewise.
	* gfortran.dg/bounds_check_array_ctor_6.f90: Likewise.
	* gcc.dg/builtin-object-size-1.c: Likewise.
	* gcc.dg/noreturn-6.c: Likewise.
	* gcc.dg/builtin-stringop-chk-1.c: Likewise.
	* gcc.dg/globalalias.c: Likewise.
	* gcc.dg/builtins-config.h: Likewise.
	* gcc.dg/pr30457.c: Likewise.
	* gcc.c-torture/compile/volatile-1.c: Likewise.
	* gcc.c-torture/execute/20101011-1.c: Likewise.
	* c-c++-common/Waddress-1.c: Likewise.

From-SVN: r233358
2016-02-12 00:53:54 +01:00
Jason Merrill 46f0d909aa re PR c++/68926 (decltype and sfinae to check for template instance availability fails to compile)
PR c++/68926

	* pt.c (resolve_nondeduced_context): Add complain parm.
	(do_auto_deduction): Pass it.
	* cvt.c (convert_to_void): Likewise.
	* decl.c (cp_finish_decl): Likewise.
	* init.c (build_new): Likewise.
	* rtti.c (get_tinfo_decl_dynamic): Likewise.
	* semantics.c (finish_decltype_type): Likewise.
	* typeck.c (decay_conversion): Likewise.
	* cp-tree.h: Adjust declaration.
	* call.c (standard_conversion): Add complain parm, pass it along.
	(implicit_conversion): Pass it.

From-SVN: r233304
2016-02-10 14:12:32 -05:00
Marek Polacek eba9e839de re PR c++/69688 (-Wsign-compare causes bogus error: size of array ‘uc_code’ is not an integral constant-expression)
PR c++/69688
	* constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
	Call clear_fold_cache.
	* cp-tree.h: Adjust declaration.
	* decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
	rather than clear_cv_cache and clear_fold_cache.
	* typeck2.c (store_init_value): Call clear_cv_and_fold_caches.

	* g++.dg/init/const12.C: New test.

From-SVN: r233220
2016-02-08 15:40:33 +00:00
Martin Sebor 05dd97db3c PR c++/69251 - [6 Regression] ICE in unify_array_domain on a flexible array
PR c++/69251 - [6 Regression] ICE in unify_array_domain on a flexible array
               member
PR c++/69253 - [6 Regression] ICE in cxx_incomplete_type_diagnostic initializing
               a flexible array member with empty string
PR c++/69290 - [6 Regression] ICE on invalid initialization of a flexible array
               member
PR c++/69277 - [6 Regression] ICE mangling a flexible array member
PR c++/69349 - template substitution error for flexible array members

gcc/testsuite/ChangeLog:
2016-02-03  Martin Sebor  <msebor@redhat.com>

	PR c++/69251
	PR c++/69253
	PR c++/69290
	PR c++/69277
	PR c++/69349
	* g++.dg/ext/flexarray-mangle-2.C: New test.
	* g++.dg/ext/flexarray-mangle.C: New test.
	* g++.dg/ext/flexarray-subst.C: New test.
	* g++.dg/ext/flexary11.C: New test.
	* g++.dg/ext/flexary12.C: New test.
	* g++.dg/ext/flexary13.C: New test.
	* g++.dg/ext/flexary14.C: New test.
	* g++.dg/other/dump-ada-spec-2.C: Adjust.

gcc/cp/ChangeLog:
2016-02-03  Martain Sebor  <msebor@redhat.com>

	PR c++/69251
	PR c++/69253
	PR c++/69290
	PR c++/69277
	PR c++/69349
	* class.c (walk_subobject_offsets): Avoid testing the upper bound
	of a flexible array member for equality to null.
	(find_flexarrays): Remove spurious whitespace introduced in r231665.
	(diagnose_flexarrays): Avoid checking the upper bound of arrays.
	(check_flexarrays): Same.
	* decl.c (compute_array_index_type): Avoid special case for flexible
	array members.
	(grokdeclarator): Avoid calling compute_array_index_type for flexible
	array members.
	* error.c (dump_type_suffix): Revert changes introduced in r231665
	and rendered unnecessary by the changes above.
	* pt.c (tsubst):  Same.
	* tree.c (build_ctor_subob_ref): Handle flexible array members.
	* typeck2.c (digest_init_r): Revert changes introduced in r231665.
	(process_init_constructor_array): Same.
	(process_init_constructor_record): Same.

From-SVN: r233126
2016-02-03 21:50:42 -07:00
Jakub Jelinek 16b77b321e re PR debug/66869 (-Wunused-function no longer warns for static declarations without definition)
PR debug/66869
	* decl.c (wrapup_globals_for_namespace): Warn about unused static
	function declarations.

	* g++.dg/warn/Wunused-function2.C: New test.

From-SVN: r232975
2016-01-29 12:14:42 +01:00
Patrick Palka a59b92b0c7 Revert "Fix the remaining PR c++/24666 blockers"
gcc/cp/ChangeLog:

	Revert:
	2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>

	PR c++/11858
	PR c++/24663
	PR c++/24664
	* decl.c (grokdeclarator): Don't decay array parameter type to
	a pointer type if it's dependent.
	(grokparms): Invoke strip_top_quals instead of directly invoking
	cp_build_qualified_type.
	* pt.c (decay_dependent_array_parm_type): New static function.
	(type_unification_real): Call decay_dependent_array_parm_type
	to decay a dependent array parameter type to its corresponding
	pointer type before unification.
	(more_specialized_fn): Likewise.
	(get_bindings): Likewise.
	* tree.c (cp_build_qualified_type): Trivial typofix in
	documentation.

gcc/testsuite/ChangeLog:

	Revert:
	2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>

	PR c++/11858
	PR c++/24663
	PR c++/24664
	* g++.dg/template/pr11858.C: New test.
	* g++.dg/template/pr24663.C: New test.
	* g++.dg/template/unify12.C: New test.
	* g++.dg/template/unify13.C: New test.
	* g++.dg/template/unify14.C: New test.
	* g++.dg/template/unify15.C: New test.
	* g++.dg/template/unify16.C: New test.
	* g++.dg/template/unify17.C: New test.

From-SVN: r232778
2016-01-24 17:45:21 +00:00
Jason Merrill 020491e63b re PR c++/65687 (Inconsistent behavior for __attribute__((__deprecated__)) between C and C++.)
PR c++/65687
	* decl.c (type_is_deprecated): Don't look into a typedef.

From-SVN: r232703
2016-01-21 15:26:21 -05:00
Jason Merrill 2f3932b910 re PR c++/40751 (G++ never packs typedef'd enums)
PR c++/40751
	PR c++/64987
	* decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.

From-SVN: r232702
2016-01-21 15:26:09 -05:00
Jason Merrill 97ca3d0d59 re PR c++/43407 (Specifying visibility attribute of C++0x enum class emits warning)
PR c++/43407
	* decl.c (start_enum): Add attributes parameter.
	* parser.c (cp_parser_enum_specifier): Pass it.
	* pt.c (lookup_template_class_1): Pass it.
	* cp-tree.h: Adjust.

From-SVN: r232701
2016-01-21 15:26:02 -05:00
Marek Polacek 1e2970064a re PR c++/68586 (Enum template parameter wrongly rejected)
PR c++/68586
	* constexpr.c (clear_cv_cache): New.
	* cp-gimplify.c (clear_fold_cache): New.
	* cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
	* decl.c (finish_enum_value_list): Call them.

	* g++.dg/cpp0x/enum30.C: New test.

From-SVN: r232562
2016-01-19 14:02:40 +00:00
Patrick Palka 17c15cb932 Fix the remaining PR c++/24666 blockers (arrays decay to pointers too early)
gcc/cp/ChangeLog:

	PR c++/11858
	PR c++/24663
	PR c++/24664
	* decl.c (grokdeclarator): Don't decay array parameter type to
	a pointer type if it's dependent.
	(grokparms): Invoke strip_top_quals instead of directly invoking
	cp_build_qualified_type.
	* pt.c (decay_dependent_array_parm_type): New static function.
	(type_unification_real): Call decay_dependent_array_parm_type
	to decay a dependent array parameter type to its corresponding
	pointer type before unification.
	(more_specialized_fn): Likewise.
	(get_bindings): Likewise.
	* tree.c (cp_build_qualified_type): Trivial typofix in
	documentation.

gcc/testsuite/ChangeLog:

	PR c++/11858
	PR c++/24663
	PR c++/24664
	* g++.dg/template/pr11858.C: New test.
	* g++.dg/template/pr24663.C: New test.
	* g++.dg/template/unify12.C: New test.
	* g++.dg/template/unify13.C: New test.
	* g++.dg/template/unify14.C: New test.
	* g++.dg/template/unify15.C: New test.
	* g++.dg/template/unify16.C: New test.
	* g++.dg/template/unify17.C: New test.

From-SVN: r232547
2016-01-19 00:19:16 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Jason Merrill 5634394598 re PR c++/66921 (failure to determine size of static constexpr array that is nested within a templated class)
PR c++/66921
	* decl.c (cp_complete_array_type): Allow an initializer that
	already has array type.

From-SVN: r231914
2015-12-22 16:46:50 -05:00
Paolo Carlini 38b69a9c11 re PR c++/67592 (A virtual member function declared constexpr fails to trigger a diagnostic)
/cp
2015-12-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/67592
	* decl.c (grokdeclarator): Reject constexpr virtual member functions;
	in error messages, prefer %<virtual%> and %<constexpr%> to virtual
	and constexpr, respectively.

/testsuite
2015-12-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/67592
	* g++.dg/cpp0x/constexpr-virtual5.C: New.
	* g++.dg/cpp0x/pr51463.C: Adjust dg-error string.
	* g++.dg/inherit/pure1.C: Likewise.

From-SVN: r231824
2015-12-18 18:18:47 +00:00
Martin Sebor f3b5cf3ddc PR objc++/68932 - FAIL: obj-c++.dg/property/at-property-23.mm -fgnu-runtime
PR objc++/68932  - FAIL: obj-c++.dg/property/at-property-23.mm -fgnu-runtime
                   (internal compiler error)

cp/
	* decl.c (grokdeclarator): Avoid assuming ctype is non-null when
	checking the validity of a flexible array member.

testsuite/
	* obj-c++.dg/property/at-property-23.mm: Remove check for
	an error message.

From-SVN: r231726
2015-12-16 16:56:27 -07:00
Martin Sebor 7e9a3ad300 struct-layout-1_generate.c: Avoid generating further fields after the first flexible array member.
gcc/testsuite/ChangeLog:
2015-12-15  Martin Sebor  <msebor@redhat.com>

	c++/42121
	c++/68478
	c++/68613
	c++/68689
	c++/68710
	* g++.dg/compat/struct-layout-1_generate.c: Avoid generating
	further fields after the first flexible array member.
	* g++.dg/ext/flexary2.C: Expect a sole flexible array member
	to be rejected.  Add a test case exercising zero-length array.
	* g++.dg/ext/flexary3.C: Expect a sole flexible array member
	to be rejected.
	* g++.dg/ext/flexary.h: New file.
	* g++.dg/ext/flexary4.C: New file.
	* g++.dg/ext/flexary5.C: New file.
	* g++.dg/ext/flexary6.C: New file.
	* g++.dg/ext/flexary7.C: New file.
	* g++.dg/ext/flexary8.C: New file.
	* g++.dg/other/dump-ada-spec-2.C: Adjust to reflect flexible
	array members.
	* g++.dg/parse/pr43765.C: Add a member to make a struct with
	a flexible array member valid.  Adjust expected error message.
	* g++.dg/torture/pr64280.C: Expect a sole flexible array member
	to be rejected.
	* g++.dg/torture/pr64312.C: Add a member to make a struct with
	a flexible array member valid.
	* g++.dg/ubsan/object-size-1.C: Adjust expected diagnostic.

gcc/cp/ChangeLog:
2015-12-15  Martin Sebor  <msebor@redhat.com>

	c++/42121
	c++/68478
	c++/68613
	c++/68689
	c++/68710
	* class.c (walk_subobject_offsets): Avoid assuming type domain
	is non-null or has an upper bound.
	(layout_class_type): Include type size in error message.
	(flexmems_t): New type.
	(field_nonempty_p, find_flexarrays, diagnose_flexarrays)
	(check_flexarrays): New	functions.
	(finish_struct_1): Call check_flexarrays.
	* decl.c (compute_array_index_type): Distinguish flexible array
	members from zero-length arrays.
	(grokdeclarator): Reject flexible array members in unions.  Avoid
	rejecting members of incomplete types that are flexible array members.
	* error.c (dump_type_suffix): Handle flexible array members with null
	upper bound.
	* init.c (perform_member_init): Same.
	* pt.c (instantiate_class_template_1): Allow flexible array members.
	(tsubst): Handle flexible array members with null upper bound.
	* typeck2.c (digest_init_r): Warn for initialization of flexible
	array members.
	(process_init_constructor_record): Handle flexible array members.

gcc/ChangeLog:
2015-12-15  Martin Sebor  <msebor@redhat.com>

	c++/42121
	* tree-chkp.c (chkp_find_bound_slots_1): Handle flexible array
	members.
	* tree.c (type_contains_placeholder_1): Avoid assuming type has
	a non-null domain or an upper bound to handle flexible array
	members.
	* varasm.c (output_constructor_regular_field):  Same.
	(output_constructor): Set min_index to integer_zero_node rather
	than null when a type has no domain to avoid crashing later.

From-SVN: r231665
2015-12-15 14:04:08 -07:00
Jason Merrill 2fa586ad98 re PR c++/68464 (ICE in valid constexpr function: ../../src/gcc/tree.c:11497)
PR c++/68464
	* cp-gimplify.c (cp_fold): Don't assume X has TREE_TYPE.
	(cp_genericize): Don't do cp_fold_r here.
	(cp_fold_function): New.
	* cp-tree.h: Declare it.
	* decl.c (finish_function): Call it and the pre-genericize plugin
	before NRV processing.

From-SVN: r231381
2015-12-07 14:34:11 -05:00
Jason Merrill 5dc5804917 PR c++/68597, fix auto9.C and auto-neg1.C with -std=c++1z.
* decl.c (check_tag_decl): Use ds_type_spec in auto diagnostic.
	* typeck.c (check_return_expr): Check for inconsistent deduction.
	* parser.c (class type_id_in_expr_sentinel): New.
	(cp_parser_primary_expression) [RID_VA_ARG]: Use it.
	(cp_parser_new_expression): Use it.
	(cp_parser_trait_expr): Use it.
	(cp_parser_type_id_1): Complain about auto if in_type_id_in_expr_p.
	(cp_parser_default_type_template_argument): Check for auto.
	(cp_parser_type_id_list): Likewise.
	(cp_parser_simple_type_specifier): Allow auto parms if flag_concepts.
	* pt.c (do_auto_deduction): Handle erroneous type.

From-SVN: r231349
2015-12-06 23:34:43 -05:00
Jakub Jelinek 2c4437019f re PR c++/67409 (tree-cfg.c dereferences a NULL pointer)
PR c++/67409
	* decl.c (identify_goto): Add LOC and DIAG_KIND arguments, call
	emit_diagnostic instead of permerror.
	(check_previous_goto_1): Adjust identify_goto callers, treat all
	cases but crossing initialization and entering scope of decl with
	non-trivial dtor as unconditional hard errors.
	(check_goto): Use identify_goto.  Treat all cases but crossing
	initialization and entering scope of decl with non-trivial dtor
	as unconditional hard errors.

	* g++.dg/eh/goto3.C: New test.

Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>

From-SVN: r230613
2015-11-19 17:18:39 +01:00
Jason Merrill cda0a029f4 Merge C++ delayed folding branch.
* call.c (build_conditional_expr_1, convert_like_real)
	(convert_arg_to_ellipsis, convert_for_arg_passing): Don't fold.
	(build_new_op_1, build_over_call, build_cxx_call): Fold for warnings.
	* class.c (build_base_path, determine_primary_bases)
	(update_vtable_entry_for_fn, check_bitfield_decl)
	(layout_nonempty_base_or_field, layout_empty_base)
	(propagate_binfo_offsets, include_empty_classes)
	(layout_class_type, build_vbase_offset_vtbl_entries): Use
	fold_convert.
	* constexpr.c (cxx_eval_builtin_function_call): Fold away the NOP_EXPR.
	(cxx_eval_call_expression): Handle MEM_REF.
	(cxx_eval_pointer_plus_expression): Fold the second operand.
	(cxx_eval_constant_expression): Handle MEM_REF, UNARY_PLUS_EXPR.
	(fold_simple_1, fold_simple): New.
	(maybe_constant_value_1): Factor out from maybe_constant_value.
	(cv_cache, maybe_constant_value): Cache results.
	(maybe_constant_init): Handle null input.
	(potential_constant_expression_1): Handle RESULT_DECL, EMPTY_CLASS_EXPR.
	* cp-array-notation.c (build_array_notation_ref): Fold operands.
	* cp-gimplify.c (cp_fold_r, cp_fold): New.
	(cp_genericize_r): Use fold_convert.  Don't fold SIZEOF_EXPR.
	(cp_genericize): Fold everything.
	(contains_label_1, contains_label_p): New.
	(cp_fold, cp_fully_fold): New.
	* cp-tree.h (class cache_map): New.
	* cvt.c (cp_convert_to_pointer, ocp_convert): Use convert_to_*_nofold.
	(cp_convert_and_check): Use cp_fully_fold.
	(convert, convert_force): Don't fold.
	* decl.c (fold_sizeof_expr): Change from fold_sizeof_expr_r.
	(compute_array_index_type): Use cp_fully_fold.
	(build_enumerator): Use fold_convert.
	* decl2.c (get_guard_cond, set_guard): Use fold_convert.
	* init.c (build_zero_init_1): Fold zero-initializers.
	(build_new_1): Fold nelts calculations.
	(build_vec_delete_1): Fold conversions.
	(build_vec_init): Fold maxindex.
	* parser.c (cp_parser_binary_expression): Fold LHS of || and &&.
	(cp_parser_question_colon_clause): Fold LHS.
	* pt.c (convert_nontype_argument): Fold nullptr conversion.
	* semantics.c (finish_unary_op_expr): Fold for warnings.
	(handle_omp_array_sections_1): Fold length and low bound.
	(handle_omp_for_class_iterator): Fold various things.
	* tree.c (builtin_valid_in_constant_expr_p): Add
	BUILT_IN_ATOMIC_ALWAYS_LOCK_FREE.
	(convert_bitfield_to_declared_type): Don't fold.
	(handle_init_priority_attribute): Fold.
	(fold_if_not_in_template): Remove.
	* typeck.c (decay_conversion, build_class_member_access_expr)
	(build_simple_component_ref, cp_build_array_ref, build_vec_cmp)
	(cp_pointer_int_sum, pointer_diff): Don't fold.
	(cp_build_binary_op): Fold for warnings and PMF ops.
	(cp_build_unary_op): Fold negation of a constant, nothing else.
	(expand_ptrmemfunc_cst): Fold operations.
	* typeck2.c (split_nonconstant_init): Fold initializer.
	(store_init_value): Likewise.
	(check_narrowing): Try folding.
	* config-lang.in (gtfiles): Add cp-gimplify.c.

From-SVN: r230365
2015-11-13 19:08:05 -05:00
Jason Merrill 9e4c469a24 decl.c (duplicate_decls): When combining typedefs, remove the new type from the variants list.
* decl.c (duplicate_decls): When combining typedefs, remove the
	new type from the variants list.

From-SVN: r230202
2015-11-11 20:16:59 -05:00
Marek Polacek e78bede6f7 re PR c/68107 (Non-VLA type whose size is half or more of the address space constructed via a pointer)
PR c/68107
	PR c++/68266
	* c-common.c (valid_array_size_p): New function.
	* c-common.h (valid_array_size_p): Declare.

	* c-decl.c (grokdeclarator): Call valid_array_size_p.  Remove code
	checking the size of an array.

	* decl.c (grokdeclarator): Call valid_array_size_p.  Remove code
	checking the size of an array.

	* c-c++-common/pr68107.c: New test.
	* g++.dg/init/new38.C (large_array_char): Adjust dg-error.
	(large_array_char_template): Likewise.
	* g++.dg/init/new44.C: Adjust dg-error.

From-SVN: r230174
2015-11-11 14:47:03 +00:00
Andrew MacLeod 69f293c908 decl.c: Remove unused header files.
ada

	* gcc-interface/decl.c: Remove unused header files.
	* gcc-interface/misc.c: Likewise.
	* gcc-interface/targtyps.c: Likewise.
	* gcc-interface/trans.c: Likewise.
	* gcc-interface/utils.c: Likewise.
c

	* c-array-notation.c: Remove unused header files.
	* c-aux-info.c: Likewise.
	* c-convert.c: Likewise.
	* c-decl.c: Likewise.
	* c-errors.c: Likewise.
	* c-lang.c: Likewise.
	* c-objc-common.c: Likewise.
	* c-parser.c: Likewise.
	* c-typeck.c: Likewise.
	* gccspec.c: Likewise.

c-family

	* array-notation-common.c: Remove unused header files.
	* c-ada-spec.c: Likewise.
	* c-cilkplus.c: Likewise.
	* c-common.c: Likewise.
	* c-cppbuiltin.c: Likewise.
	* c-dump.c: Likewise.
	* c-format.c: Likewise.
	* c-gimplify.c: Likewise.
	* c-indentation.c: Likewise.
	* c-lex.c: Likewise.
	* c-omp.c: Likewise.
	* c-opts.c: Likewise.
	* c-pch.c: Likewise.
	* c-ppoutput.c: Likewise.
	* c-pragma.c: Likewise.
	* c-pretty-print.c: Likewise.
	* c-semantics.c: Likewise.
	* c-ubsan.c: Likewise.
	* cilk.c: Likewise.
	* stub-objc.c: Likewise.

cp

	* call.c: Remove unused header files.
	* class.c: Likewise.
	* constexpr.c: Likewise.
	* cp-array-notation.c: Likewise.
	* cp-cilkplus.c: Likewise.
	* cp-gimplify.c: Likewise.
	* cp-lang.c: Likewise.
	* cp-objcp-common.c: Likewise.
	* cp-ubsan.c: Likewise.
	* cvt.c: Likewise.
	* cxx-pretty-print.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* dump.c: Likewise.
	* error.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* friend.c: Likewise.
	* g++spec.c: Likewise.
	* init.c: Likewise.
	* lambda.c: Likewise.
	* lex.c: Likewise.
	* mangle.c: Likewise.
	* method.c: Likewise.
	* name-lookup.c: Likewise.
	* optimize.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* ptree.c: Likewise.
	* repo.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.
	* semantics.c: Likewise.
	* tree.c: Likewise.
	* typeck.c: Likewise.
	* typeck2.c: Likewise.
	* vtable-class-hierarchy.c: Likewise.

Fortran

	* array.c: Remove unused header files.
	* convert.c: Likewise.
	* cpp.c: Likewise.
	* decl.c: Likewise.
	* f95-lang.c: Likewise.
	* frontend-passes.c: Likewise.
	* iresolve.c: Likewise.
	* match.c: Likewise.
	* module.c: Likewise.
	* options.c: Likewise.
	* parse.c: Likewise.
	* target-memory.c: Likewise.
	* trans-array.c: Likewise.
	* trans-common.c: Likewise.
	* trans-const.c: Likewise.
	* trans-decl.c: Likewise.
	* trans-expr.c: Likewise.
	* trans-intrinsic.c: Likewise.
	* trans-io.c: Likewise.
	* trans-openmp.c: Likewise.
	* trans-stmt.c: Likewise.
	* trans-types.c: Likewise.
	* trans.c: Likewise.

go

	* go-backend.c: Remove unused header files.
	* go-gcc.cc: Likewise.
	* go-lang.c: Likewise.
	* gospec.c: Likewise.

Java

	* boehm.c: Remove unused header files.
	* builtins.c: Likewise.
	* class.c: Likewise.
	* constants.c: Likewise.
	* decl.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* java-gimplify.c: Likewise.
	* jcf-dump.c: Likewise.
	* jcf-io.c: Likewise.
	* jcf-parse.c: Likewise.
	* jvgenmain.c: Likewise.
	* lang.c: Likewise.
	* mangle.c: Likewise.
	* mangle_name.c: Likewise.
	* resource.c: Likewise.
	* typeck.c: Likewise.
	* verify-glue.c: Likewise.
	* verify-impl.c: Likewise.
	* zextract.c: Likewise.

jit

	* dummy-frontend.c: Remove unused header files.
	* jit-builtins.c: Likewise.
	* jit-playback.c: Likewise.
	* jit-recording.c: Likewise.
	* jit-spec.c: Likewise.
	* libgccjit.c: Likewise.

lto

	* lto-lang.c: Remove unused header files.
	* lto-object.c: Likewise.
	* lto-partition.c: Likewise.
	* lto-symtab.c: Likewise.
	* lto.c: Likewise.

objc

	* objc-act.c: Remove unused header files.
	* objc-encoding.c: Likewise.
	* objc-gnu-runtime-abi-01.c: Likewise.
	* objc-lang.c: Likewise.
	* objc-map.c: Likewise.
	* objc-next-runtime-abi-01.c: Likewise.
	* objc-next-runtime-abi-02.c: Likewise.
	* objc-runtime-shared-support.c: Likewise.

objcp

	* objcp-decl.c: Remove unused header files.
	* objcp-lang.c: Likewise.

From-SVN: r230166
2015-11-11 14:18:08 +00:00
Andrew MacLeod 2adfab879c decl.c: Reorder #include's and remove duplicates.
ada
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* gcc-interface/decl.c: Reorder #include's and remove duplicates.
	* gcc-interface/misc.c: Likewise.
	* gcc-interface/targtyps.c: Likewise.
	* gcc-interface/trans.c: Likewise.
	* gcc-interface/utils.c: Likewise.
	
c
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* c-array-notation.c: Reorder #include's and remove duplicates.
	* c-aux-info.c: Likewise.
	* c-convert.c: Likewise.
	* c-decl.c: Likewise.
	* c-errors.c: Likewise.
	* c-lang.c: Likewise.
	* c-objc-common.c: Likewise.
	* c-parser.c: Likewise.
	* c-typeck.c: Likewise.

c-family
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* array-notation-common.c: Reorder #include's and remove duplicates.
	* c-ada-spec.c: Likewise.
	* c-cilkplus.c: Likewise.
	* c-common.c: Likewise.
	* c-cppbuiltin.c: Likewise.
	* c-dump.c: Likewise.
	* c-format.c: Likewise.
	* c-gimplify.c: Likewise.
	* c-indentation.c: Likewise.
	* c-lex.c: Likewise.
	* c-omp.c: Likewise.
	* c-opts.c: Likewise.
	* c-pch.c: Likewise.
	* c-ppoutput.c: Likewise.
	* c-pragma.c: Likewise.
	* c-pretty-print.c: Likewise.
	* c-semantics.c: Likewise.
	* c-ubsan.c: Likewise.
	* cilk.c: Likewise.
	* stub-objc.c: Likewise.

cp
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* call.c: Reorder #include's and remove duplicates.
	* class.c: Likewise.
	* constexpr.c: Likewise.
	* cp-array-notation.c: Likewise.
	* cp-cilkplus.c: Likewise.
	* cp-gimplify.c: Likewise.
	* cp-lang.c: Likewise.
	* cp-objcp-common.c: Likewise.
	* cp-ubsan.c: Likewise.
	* cvt.c: Likewise.
	* cxx-pretty-print.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* dump.c: Likewise.
	* error.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* friend.c: Likewise.
	* init.c: Likewise.
	* lambda.c: Likewise.
	* lex.c: Likewise.
	* mangle.c: Likewise.
	* method.c: Likewise.
	* name-lookup.c: Likewise.
	* optimize.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* ptree.c: Likewise.
	* repo.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.
	* semantics.c: Likewise.
	* tree.c: Likewise.
	* typeck.c: Likewise.
	* typeck2.c: Likewise.
	* vtable-class-hierarchy.c: Likewise.

fortran

2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* array.c: Reorder #include's and remove duplicates.
	* convert.c: Likewise.
	* cpp.c: Likewise.
	* decl.c: Likewise.
	* f95-lang.c: Likewise.
	* frontend-passes.c: Likewise.
	* iresolve.c: Likewise.
	* match.c: Likewise.
	* module.c: Likewise.
	* options.c: Likewise.
	* parse.c: Likewise.
	* resolve.c: Likewise.
	* simplify.c: Likewise.
	* target-memory.c: Likewise.
	* trans-array.c: Likewise.
	* trans-common.c: Likewise.
	* trans-const.c: Likewise.
	* trans-decl.c: Likewise.
	* trans-expr.c: Likewise.
	* trans-intrinsic.c: Likewise.
	* trans-io.c: Likewise.
	* trans-openmp.c: Likewise.
	* trans-stmt.c: Likewise.
	* trans-types.c: Likewise.
	* trans.c: Likewise.

go
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* go-backend.c: Reorder #include's and remove duplicates.
	* go-lang.c: Likewise.

java
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* boehm.c: Reorder #include's and remove duplicates.
	* builtins.c: Likewise.
	* class.c: Likewise.
	* constants.c: Likewise.
	* decl.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* java-gimplify.c: Likewise.
	* jcf-dump.c: Likewise.
	* jcf-io.c: Likewise.
	* jcf-parse.c: Likewise.
	* jvgenmain.c: Likewise.
	* lang.c: Likewise.
	* mangle.c: Likewise.
	* mangle_name.c: Likewise.
	* resource.c: Likewise.
	* typeck.c: Likewise.
	* verify-glue.c: Likewise.
	* verify-impl.c: Likewise.

jit
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* dummy-frontend.c: Reorder #include's and remove duplicates.
	* jit-builtins.c: Likewise.
	* jit-playback.c: Likewise.
	* jit-recording.c: Likewise.
	* libgccjit.c: Likewise.

lto
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* lto-lang.c: Reorder #include's and remove duplicates.
	* lto-object.c: Likewise.
	* lto-partition.c: Likewise.
	* lto-symtab.c: Likewise.
	* lto.c: Likewise.

objc
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* objc-lang.c: Reorder #include's and remove duplicates.
	* objc-map.c: Likewise.

objcp
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* objcp-decl.c: Reorder #include's and remove duplicates.
	* objcp-lang.c: Likewise.

From-SVN: r229533
2015-10-29 15:27:20 +00:00
Paolo Carlini f58b8cd70e re PR c++/67845 (ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854)
/cp
2015-10-29  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/67845
	* decl.c (grokfndecl): In case of erroneous cv-qualified non-member
	functions consistently reset TREE_TYPE (decl) too.

/testsuite
2015-10-29  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/67845
	* g++.dg/other/cv_func4.C: New.

From-SVN: r229523
2015-10-29 13:12:45 +00:00