aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2009-07-14sourcebuild.texi: Document install-plugin target.Taras Glek2-0/+21
2009-07-14 Taras Glek <tglek@mozilla.com> Rafael Espindola <espindola@google.com> * doc/sourcebuild.texi: Document install-plugin target. * configure.ac: Added install-plugin target to language makefiles. * configure: Regenerate. * Makefile.in: (install-plugin): Install more headers, depend on lang.install-plugin. ada/ChangeLog * gcc-interface/Make-lang.in (ada.install-plugin): New target for installing plugin headers. cp/ChangeLog * Make-lang.in: Added CP_PLUGIN_HEADERS and c.install-target to export cp-tree.h cxx-pretty-print.h name-lookup.h headers for plugins. fortran/ChangeLog * Make-lang.in (fortran.install-plugin): New target for installing plugin headers. java/ChangeLog * Make-lang.in (java.install-plugin): New target for installing plugin headers. objc/ChangeLog * Make-lang.in (objc.install-plugin): New target for installing plugin headers. objcp/ChangeLog * Make-lang.in (obj-c.install-plugin): New target for installing plugin headers. Co-Authored-By: Rafael Avila de Espindola <espindola@google.com> From-SVN: r149648
2009-07-14re PR c++/37276 (Trouble with some (C99?) math builtins and namespace std)Jason Merrill2-2/+12
PR c++/37276 * decl.c (decls_match): A non-extern-C declaration doesn't match a builtin extern-C declaration. From-SVN: r149638
2009-07-14name-lookup.c (qualified_lookup_using_namespace): Don't stop looking in used ↵Jason Merrill2-6/+11
namespaces just because we found something on... * name-lookup.c (qualified_lookup_using_namespace): Don't stop looking in used namespaces just because we found something on another branch. From-SVN: r149637
2009-07-14re PR c++/40740 (template-id forgotten with arg-dep lookup)Jason Merrill2-2/+10
PR c++/40740 * semantics.c (perform_koenig_lookup): Handle empty template args. From-SVN: r149636
2009-07-14builtins.c (can_trust_pointer_alignment): New fn.Jason Merrill2-3/+7
* builtins.c (can_trust_pointer_alignment): New fn. (get_pointer_alignment): Factor it out from here. * tree.h: Declare it. * cp/call.c (build_over_call): Use it. From-SVN: r149635
2009-07-14re PR debug/40705 (ICE in gen_type_die_with_usage, at dwarf2out.c:15117)Dodji Seketeli2-1/+10
2009-07-14 Dodji Seketeli <dodji@redhat.com> gcc/ChangeLog: PR debug/40705 PR c++/403057 * dwarf2.out.c (gen_type_die_with_usage): Added comment. gcc/cp/ChangeLog: PR debug/40705 PR c++/403057 * decl2.c (grokfield): Don't call set_underlying_type on typedef decls that are type names. gcc/testsuite/ChangeLog: PR debug/40705 PR c++/403057 * g++.dg/debug/dwarf2/typedef1.C: New test. * g++.dg/other/typedef3.C: Likewise. From-SVN: r149628
2009-07-13re PR c++/22154 ([DR 382] qualified names should allow typename keyword in ↵Andrew Pinski2-6/+10
front of it (even in non-templates)) 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/22154 * parser.c (cp_parser_elaborated_type_specifier): Accept typename in front of qualified names. 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/22154 * g++.old-deja/g++.pt/typename10.C: Update for DR 382, typename in front of qualified names are allowed. * g++.dg/parse/crash10.C: Likewise. * g++.dg/parse/error15.C: Likewise. * g++.dg/parse/typename9.C: Likewise. * g++.dg/parse/error8.C: Likewise. From-SVN: r149590
2009-07-12re PR c++/36628 ([c++0x] incorrect decltype() handling of conditional operator)Jason Merrill2-1/+6
PR c++/36628 * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p. From-SVN: r149536
2009-07-12cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.Jason Merrill4-43/+50
* cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref. * tree.c (lvalue_p_1): Return it. Remove treat_class_rvalues_as_lvalues parm. (real_lvalue_p): Disallow pseudo-lvalues here. (lvalue_or_rvalue_with_address_p): New fn. * call.c (initialize_reference): Use it instead of real_lvalue_p. From-SVN: r149534
2009-07-12re PR c++/40689 ([C++0x]: error with initializer list in N2672)Jason Merrill4-13/+52
PR c++/40689 * init.c (build_new_1): Handle initializer list as array initializer. (build_vec_init): Likewise. * typeck.c (cp_build_modify_expr): Likewise. * typeck2.c (process_init_constructor_array): Error rather than abort if too many initializers. From-SVN: r149533
2009-07-10re PR middle-end/40502 (crash in cp_diagnostic_starter)Jakub Jelinek2-2/+7
PR c++/40502 * error.c (cp_print_error_function): Check for NULL block. * g++.dg/ext/strncpy-chk1.C: New test. From-SVN: r149470
2009-07-09pt.c (perform_typedefs_access_check, [...]): Use CLASS_TYPE_P.Simon Martin2-3/+9
gcc/cp/ 2008-07-08 Simon Martin <simartin@users.sourceforge.net> Jason Merrill <jason@redhat.com> * pt.c (perform_typedefs_access_check, get_types_needing_access_check, append_type_to_template_for_access_check_1): Use CLASS_TYPE_P. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r149439
2009-07-09re PR c++/40684 (ICE in tsubst)Dodji Seketeli2-2/+9
2009-07-09 Dodji Seketeli <dodji@redhat.com> gcc/cp/ChangeLog: PR c++/40684 * pt.c (type_unification_real): Use tsubst_template_arg instead of tsubst to substitute default template arguments. gcc/testsuite/ChangeLog: PR c++/40684 * g++.dg/template/unify11.C: New test. From-SVN: r149423
2009-07-07re PR c++/31246 (-Wunreachable-code warnings for compiler-generated code)Manuel López-Ibáñez3-3/+23
2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c++/31246 * gimplify.c (gimplify_expr): Propagate no_warning flag when gimplifying. * gimple (gimple_build_call_from_tree): Likewise. * tree-cfg.c (remove_useless_stmts_warn_notreached): Check no_warning flag before warning. cp/ * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated code. * cp-gimplify.c (genericize_eh_spec_block): Likewise. testsuite/ * g++.dg/warn/pr31246.C: New. * g++.dg/warn/pr31246-2.C: New. From-SVN: r149354
2009-07-07re PR c++/35828 ([C++0x] ICE on default template template parameter in ↵Jason Merrill2-6/+11
template function) PR c++/35828 * pt.c (tsubst_decl): Don't abort if we didn't change anything in a TEMPLATE_DECL's args. From-SVN: r149351
2009-07-07tree.c (set_expr_locus): Remove.Manuel López-Ibáñez2-1/+6
2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org> * tree.c (set_expr_locus): Remove. * tree.h (EXPR_LOCUS,SET_EXPR_LOCUS,set_expr_locus): Remove. * c-typeck.c (c_finish_stmt_expr): Replace EXPR_LOCUS by EXPR_LOCATION. * gimplify.c (internal_get_tmp_var): Likewise. (gimplify_call_expr): Likewise. (gimplify_one_sizepos): Likewise. objc/ * objc-act.c (next_sjlj_build_catch_list): Replace EXPR_LOCUS by EXPR_LOCATION. cp/ * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by EXPR_LOCATION. ada/ * gcc-interface/trans.c (gnat_gimplify_expr): Replace EXPR_LOCUS by EXPR_LOCATION. From-SVN: r149350
2009-07-07re PR c++/37816 ([c++0x] Invalid handling of scoped enums defined at class ↵Jason Merrill2-2/+16
scope) PR c++/37816 * decl.c (build_enumerator): Don't add enumerators for a scoped enum to the enclosing class. PR c++/40639 * decl.c (start_enum): Allow dependent underlying type. PR c++/40633 * decl.c (finish_enum): Finish scope even in a template. From-SVN: r149341
2009-07-07cgraphunit.c: Replace %J by an explicit location.Manuel López-Ibáñez6-52/+83
2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org> * cgraphunit.c: Replace %J by an explicit location. Update all calls. * c-decl.c: Likewise. * function.c: Likewise. * varasm.c: Likewise. * tree-ssa.c: Likewise. * c-common.c: Likewise. * tree-cfg.c: Likewise. * config/spu/spu.c: Likewise. * config/ia64/ia64.c: Likewise. * config/v850/v850.c: Likewise. java/ * class.c: Replace %J by an explicit location. Update all calls. objc/ * objc-act.c: Replace %J by an explicit location. Update all calls. cp/ * init.c: Replace %J by an explicit location. Update all calls. * decl.c: Likewise. * typeck2.c: Likewise. * pt.c: Likewise. * name-lookup.c: Likewise. From-SVN: r149312
2009-07-06decl.c: Replace %H by an explicit location.Manuel López-Ibáñez5-267/+297
2009-07-06 Manuel López-Ibáñez <manu@gcc.gnu.org> cp/ * decl.c: Replace %H by an explicit location. Update all calls. * except.c: Likewise. * semantics.c: Likewise. * parser.c: Likewise. From-SVN: r149277
2009-07-06re PR c++/40557 (ICE with template union)Simon Martin2-3/+11
gcc/cp/ 2009-07-06 Simon Martin <simartin@users.sourceforge.net> PR c++/40557 * pt.c (perform_typedefs_access_check, get_types_needing_access_check, append_type_to_template_for_access_check_1): Use RECORD_OR_UNION_CODE_P. gcc/testsuite/ 2009-07-06 Simon Martin <simartin@users.sourceforge.net> PR c++/40557 * g++.dg/template/union2.C: New test. From-SVN: r149276
2009-07-04pt.c (retrieve_specialization): Don't get confused by a using-declaration ↵Jason Merrill3-1/+14
that brings in another instance of... * pt.c (retrieve_specialization): Don't get confused by a using-declaration that brings in another instance of this template from a base class. * ptree.c (cxx_print_type): Fix logic. From-SVN: r149247
2009-07-04* cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.Jason Merrill2-1/+3
From-SVN: r149239
2009-07-04re PR c++/40619 ([c++0x] ICE on repeated decltype expression in auto functions)Jason Merrill8-29/+56
PR c++/40619 * cp-tree.h (struct lang_decl_parm): New. (struct lang_decl): Add it. (LANG_DECL_PARM_CHECK): New. (DECL_PARM_INDEX): New. * decl2.c (parm_index): Remove. * lex.c (retrofit_lang_decl): Handle parms. (cxx_dup_lang_specific_decl): Likewise. * mangle.c (write_expression): Adjust. * tree.c (cp_tree_equal): Adjust. (decl_linkage): Only check DECL_COMDAT for functions and variables. * parser.c (cp_parser_parameter_declaration_list): Set DECL_PARM_INDEX. * pt.c (iterative_hash_template_arg): Hash it. From-SVN: r149223
2009-07-03cp-tree.h (struct lang_decl): Overhaul.Jason Merrill13-380/+430
* cp-tree.h (struct lang_decl): Overhaul. (struct lang_decl_flags): Remove. (struct lang_decl_base): New. (struct lang_decl_min): New. (struct lang_decl_fn): New. (struct lang_decl_ns): New. (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN. (LANG_DECL_MIN_CHECK): New. (LANG_DECL_FN_CHECK): New. (LANG_DECL_NS_CHECK): New. (STRIP_TEMPLATE): New. (NON_THUNK_FUNCTION_CHECK): Remove. (DECL_DECLARES_FUNCTION_P): New. (lots): Adjust. * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust. * decl.c (push_local_name, duplicate_decls): Adjust. * decl2.c (start_objects): Don't set u2sel. * semantics.c (finish_omp_threadprivate): Adjust. * class.c (build_clone): Don't do much on TEMPLATE_DECLs. (decl_cloned_function_p): Out-of-line implementation of macros. (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P. * mangle.c (write_unqualified_name): Don't check function flags on non-functions. * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION. * pt.c (build_template_decl): Don't set function flags. (check_default_tmpl_args): Check that it's a function. (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the cloned template. * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst DECL_CLONED_FUNCTION. * cp-tree.h (struct lang_type_class): Move sorted_fields here. * class.c (finish_struct_1): Adjust. * ptree.c (cxx_print_decl, cxx_print_type): Adjust. * search.c (lookup_field_1): Adjust. * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove. * decl.c (finish_method): Don't add to it. * class.c (fixup_pending_inline): Remove. (fixup_inline_methods): Remove. (finish_struct_1): Don't call it. * error.c (dump_function_name): Handle null name. From-SVN: r149217
2009-07-02typeck.c (cp_build_binary_op): Move warnings about use of NULL in arithmetic ↵Mark Mitchell2-20/+25
earlier and allow comparisions of... 2009-07-02 Mark Mitchell <mark@codesourcery.com> * typeck.c (cp_build_binary_op): Move warnings about use of NULL in arithmetic earlier and allow comparisions of NULL with pointers-to-members. 2009-07-02 Mark Mitchell <mark@codesourcery.com> * g++.dg/warn/null4.C: Extend. From-SVN: r149190
2009-07-02Use hash tables for template specialization lookup.Jason Merrill4-237/+474
* pt.c (struct spec_entry): New type. (decl_specializations, type_specializations): New hash tables. (register_specialization, retrieve_specialization): Use them. (reregister_specialization, lookup_template_class): Use them. (eq_specializations, hash_tmpl_and_args, hash_specialization): New. (iterative_hash_template_arg): New. (init_template_processing): New (process_partial_specialization): Don't look to see if we already have this partial specialization. (maybe_process_partial_specialization): Handle reassigning full specializations when we get an explicit specialization of the partial instantiation. (tsubst_friend_function): Adjust specialization reassignment code. (instantiate_template): Only do one lookup. (instantiate_decl): Don't do any lookup. * cp-tree.h: Declare init_template_processing. * decl.c (duplicate_decls): Pass args to reregister_specialization. From-SVN: r149188
2009-07-01* cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.Jason Merrill2-5/+6
From-SVN: r149166
2009-07-01pt.c (register_specialization): Use duplicate_decls to merge the argument ↵Jason Merrill2-3/+15
with a previous specialization. * pt.c (register_specialization): Use duplicate_decls to merge the argument with a previous specialization. (check_explicit_specialization): Call register_specialization to merge the TEMPLATE_DECL with a previous version. (determine_specialization): Return the args even if fn is a template. From-SVN: r149165
2009-07-01* g++spec.c (lang_specific_driver): Bump num_args by 1.Ian Lance Taylor2-1/+5
From-SVN: r149147
2009-06-30re PR c++/40595 ([C++0x] ICE trying to use sfinae with variadic template ↵Jason Merrill2-2/+15
pack expansion) PR c++/40595 * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an EXPR_PACK_EXPANSION. From-SVN: r149117
2009-06-29re PR c++/40274 (Revision 145566 caused ICE in tsubst, at cp/pt.c:9289)Jason Merrill2-6/+12
PR c++/40274 * error.c (dump_template_parms): Pass all args to count_non_default_template_args. (count_non_default_template_args): Pull out the inner ones. From-SVN: r149066
2009-06-26decl.c (duplicate_decls): Re-indent.H.J. Lu2-5/+9
2009-06-26 H.J. Lu <hongjiu.lu@intel.com> * decl.c (duplicate_decls): Re-indent. From-SVN: r148983
2009-06-25call.c (avoid_sign_compare_warnings): New static function.Ian Lance Taylor3-0/+35
cp/: * call.c (avoid_sign_compare_warnings): New static function. (build_new_op): Call it. * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if TREE_NO_WARNING is set on either operand. testsuite/: * g++.dg/warn/Wsign-compare-3.C: New testcase. From-SVN: r148952
2009-06-25g++spec.c (SKIPOPT): define.Ian Lance Taylor2-15/+50
cp/: * g++spec.c (SKIPOPT): define. (lang_specific_driver): Handle -static-libstdc++. Only add LIBSTDCXX_STATIC if we add LIBSTDCXX. ./: * doc/invoke.texi (Option Summary): Mention -static-libstdc++. (Link Options): Document -static-libstdc++. From-SVN: r148951
2009-06-25cvt.c (convert_to_void): Only warn about COND_EXPR if neither the second nor ↵Ian Lance Taylor2-2/+8
third operand has side effects. cp/: * cvt.c (convert_to_void): Only warn about COND_EXPR if neither the second nor third operand has side effects. testsuite/: * g++.dg/warn/Wunused-16.C: New testcase. From-SVN: r148950
2009-06-25parser.c (cp_parser_binary_expression): Increment ↵Ian Lance Taylor3-1/+23
c_inhibit_evaluation_warnings while parsing the right hand side of... cp/: * parser.c (cp_parser_binary_expression): Increment c_inhibit_evaluation_warnings while parsing the right hand side of "true || x" or "false && x". * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare if c_inhibit_evaluation_warnings is zero. testsuite/: * g++.dg/warn/skip-2.C: New testcase. From-SVN: r148949
2009-06-24* error.c (dump_decl): Do say "typedef" for the injected class name.Jason Merrill2-1/+3
From-SVN: r148916
2009-06-24pt.c (lookup_template_class): Use currently_open_class, compare template ↵Jason Merrill2-25/+10
args later. * pt.c (lookup_template_class): Use currently_open_class, compare template args later. From-SVN: r148915
2009-06-24re PR c++/40342 (ambiguous overload not diagnosed)Jason Merrill3-1/+18
PR c++/40342 * decl.c (decls_match): Check DECL_TI_TEMPLATE too. * class.c (resolve_address_of_overloaded_function): Fix typo. From-SVN: r148910
2009-06-18class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.Aldy Hernandez8-19/+22
* class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl. * decl.c (finish_decl): Remove. (declare_global_var): Replace finish_decl with cp_finish_decl. (start_method): Same. * rtti.c (emit_tinfo_decl): Same. * pt.c (tsubst_expr): Same. (instantiate_decl): Same. * decl2.c (grokbitfield): Same. * name-lookup.c (pushdecl_top_level_1): Same. * cp-tree.h: Remove finish_decl. From-SVN: r148666
2009-06-16aix.h (LIBSTDCXX_STATIC): Remove -lstdc++.David Edelsohn2-5/+20
* config/rs6000/aix.h (LIBSTDCXX_STATIC): Remove -lstdc++. cp/ * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL. (lang_specific_driver): Always allocate extra argument. Add LIBSTDCXX_STATIC to arglist if defined and linking statically. From-SVN: r148546
2009-06-16Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.Ian Lance Taylor2-2/+8
* Make-lang.in (cp/class.o): Depend upon gt-cp-class.h. (cp/semantics.o): Depend upon gt-cp-semantics.h. From-SVN: r148544
2009-06-16c-common.c (skip_evaluation): Don't define.Ian Lance Taylor12-42/+140
./: * c-common.c (skip_evaluation): Don't define. (c_inhibit_evaluation_warnings): Define global variable. (overflow_warning): Check c_inhibit_evaluation_warnings rather than skip_evaluation. (convert_and_check, warn_for_div_by_zero): Likewise. * c-common.h (skip_evaluation): Don't declare. (c_inhibit_evaluation_warnings): Declare. * c-parser.c (c_parser_typeof_specifier): Set c_inhibit_evaluation_warnings rather than skip_evaluation. (c_parser_conditional_expression): Likewise. (c_parser_binary_expression): Likewise. (c_parser_sizeof_expression): Likewise. (c_parser_alignof_expression): Likewise. * c-typeck.c (build_indirect_ref): Check c_inhibit_evaluation_warnings rather than skip_evaluation. (build_conditional_expr, build_binary_op): Likewise. cp/: * parser.c (cp_unevaluated_operand): Define global variable. (cp_parser_question_colon_clause): Increment c_inhibit_evaluation_warnings when evaluating an expression which will never be executed. (cp_parser_decltype): Increment cp_unevaluated_operand and c_inhibit_evaluation_warnings, not skip_evaluation. (cp_parser_sizeof_operand): Likewise. (cp_parser_enclosed_template_argument_list): Save cp_unevaluated_operand and c_inhibit_evaluation_warnings, not skip_evaluation. * cp-tree.h (struct saved_scope): Remove skip_evaluation field. Add unevaluated_operand and inhibit_evaluation_warnings fields. (cp_unevaluated_operand): Declare. * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand and c_inhibit_evaluation_warnings rather than skip_evaluation. (pop_from_top_level): Restore cp_unevaluated_operand and c_inhibit_evaluation_warnings rather than skip_evaluation. * class.c (build_base_path): Check cp_unevaluated_operand rather than skip_evaluation. * typeck.c (build_class_member_access_expr): Likewise. (cp_build_binary_op): Don't warn about bad shift counts if c_inhibit_evaluation_warnings is non-zero. * pt.c (coerce_template_parms): Save state of cp_unevaluated_operand and c_inhibit_evaluation_warnings, not skip_evaluation. (tsubst_aggr_type): Likewise. (tsubst_pack_expansion): Check cp_unevaluated_operand rather than skip_evaluation. (tsubst_copy): Likewise. (tsubst): Set cp_unevaluated_operand and c_inhibit_evaluation_warnings, not skip_evaluation. (tsubst_copy_and_build): Likewise. * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand rather than skip_evaluation. * decl2.c (mark_used): Likewise. * semantics.c (finish_non_static_data_member): Likewise. * cvt.c (cp_convert_and_check): Check c_inhibit_evaluation_warnings rather than skip_evaluation. * mangle.c (write_type): Set cp_unevaluated_operand rather than skip_evaluation. testsuite/: * g++.dg/warn/skip-1.C: New testcase. From-SVN: r148535
2009-06-16df-problems.c (df_simulate_one_insn_forwards): Fix braces in switch.Ian Lance Taylor2-162/+169
./: * df-problems.c (df_simulate_one_insn_forwards): Fix braces in switch. * gcov.c (read_count_file): Add braces around variables declared before label. * c.opt (Wjump-misses-init): New warning. * c-opts.c (c_common_handle_option): Set warn_jump_misses_init for -Wall and -Wc++-compat if not already set. (c_common_post_options): Clear warn_jump_misses_init if it was not set. * c-decl.c (struct c_binding): Change type field to a union with new label field. Make it the first field in the struct. Update references to type to use u.type instead. (struct c_spot_bindings): Define. (struct c_goto_bindings): Define. (c_goto_bindings_p): Define, along with VECs. (struct c_label_vars): Define. (struct c_scope): Add has_label_bindings field. (bind_label, set_spot_bindings): New static functions. (decl_jump_unsafe, update_spot_bindings): New static functions. (update_label_decls): New static function. (pop_scope): Call update_label_decls. Don't call c_end_vm_scope. Update binding u.label field to shadowed field. (c_binding_start_stmt_expr): New function. (c_binding_end_stmt_expr): New function. (pushdecl): Don't call c_begin_vm_scope. (make_label): Add defining and p_label_vars parameters. Change all callers. (lookup_label): Correct test for whether a label has not yet been defined. Call bind_label rather than bind. (warn_about_goto): New static function. (lookup_label_for_goto): New function. (declare_label): Call bind_label rather than bind. (check_earlier_gotos): New static function. (define_label): Don't give errors about jumping into statement expressions or scopes of variably modified types. Call set_spot_bindings and check_earlier_gotos. Call bind_label instead of bind. Don't set label_context_stack_se or label_context_stack_vm. (c_get_switch_bindings): New function. (c_release_switch_bindings): New function. (c_check_switch_jump_warnings): New function. (start_function): Don't set label_context_stack_se or label_context_stack_vm. (finish_function): Likewise. * c-typeck.c (label_context_stack_se): Don't define. (label_context_stack_vm): Don't define. (c_finish_goto_label): Call lookup_label_for_goto rather than lookup_label. Don't give errors about jumping into a statement expression or the scope of a variably modified type. Don't set label_context_stack_se or label_context_stack_vm. (struct c_switch): Remove blocked_stmt_expr and blocked_vm fields. Add bindings field. (c_start_case): Don't set deleted fields. Set bindings field. (do_case): Rework order of tests. Don't check blocked_stmt_expr or blocked_vm. Call c_check_switch_jump_warnings. (c_finish_case): Don't test blocked_stmt_expr field. Call c_release_switch_bindings. (c_begin_stmt_expr): Don't increment blocked_stmt_expr in c_switch_stack. Don't walk label_context_stack_se labels. Don't set label_context_stack_se. Call c_bindings_start_stmt_expr. (c_finish_stmt_expr): Don't decrement blocked_stmt_expr in c_switch_stack. Don't walk label_context_stack_se labels. Don't set label_context_stack_se. Call c_bindings_end_stmt_expr. (c_begin_vm_scope, c_end_vm_scope): Don't define. * c-tree.h (C_DECL_UNJUMPABLE_STMT_EXPR): Don't define. (C_DECL_UNDEFINABLE_STMT_EXPR): Don't define. (C_DECL_UNJUMPABLE_VM): Don't define. (C_DECL_UNDEFINABLE_VM): Don't define. (struct c_label_list): Don't define. (struct c_label_context_se): Don't define. (struct c_label_context_vm): Don't define. (struct c_spot_bindings): Declare. (c_bindings_start_stmt_expr): Declare. (c_bindings_end_stmt_expr): Declare. (lookup_label_for_goto): Declare. (c_get_switch_bindings, c_release_switch_bindings): Declare. (c_check_switch_jump_warnings): Declare. (label_context_stack_se, label_context_stack_vm): Don't declare. (c_finish_goto_label): Update declaration. (c_begin_vm_scope, c_end_vm_scope): Don't declare. * doc/invoke.texi (Option Summary): Mention -Wjump-misses-init. (Warning Options): Document -Wjump-misses-init. cp/: * parser.c (cp_parser_direct_declarator): Add braces around variables declared before label. objc/: * objc-act.c (objc_start_function): Don't set label_context_stack_se or label_context_stack_vm. testsuite/: * gcc.dg/Wjump-misses-init-1.c: New testcase. * gcc.dg/Wjump-misses-init-2.c: New testcase. * gcc.dg/c99-vla-jump-5.c: Adjust expected error messages. Recognize new notes. * gcc.dg/stmt-expr-label-2.c: Likewise. * gcc.dg/c99-vla-jump-1.c: Recognize new notes. Fix column numbers. * gcc.dg/c99-vla-jump-2.c: Recognize new notes. * gcc.dg/c99-vla-jump-3.c: Recognize new notes. * gcc.dg/c99-vla-jump-4.c: Likewise. * gcc.dg/stmt-expr-label-1.c: Likewise. * gcc.dg/stmt-expr-label-3.c: Likewise. * gcc.dg/vla-8.c: Likewise. Move error message to different line. From-SVN: r148512
2009-06-15cgraphunit.c (cgraph_function_versioning,save_inline_function_body): Use ↵Rafael Avila de Espindola7-12/+29
DECL_COMDAT_GROUP instead of DECL_ONE_ONLY. 2009-06-15 Rafael Avila de Espindola <espindola@google.com> * cgraphunit.c (cgraph_function_versioning,save_inline_function_body): Use DECL_COMDAT_GROUP instead of DECL_ONE_ONLY. * cgraph.c (cgraph_create_virtual_clone): Use DECL_COMDAT_GROUP. * config/i386/i386.c (ix86_file_end): Compute DECL_COMDAT_GROUP. * dwarf2asm.c(dw2_force_const_mem): Update call to make_decl_one_only. * langhooks-def.h (lhd_comdat_group, LANG_HOOKS_COMDAT_GROUP): Remove. (LANG_HOOKS_DECLS): Remove LANG_HOOKS_COMDAT_GROUP. * langhooks.c (lhd_comdat_group): Remove. * langhooks.h (lang_hooks_for_decls): Remove comdat_group. * tree.h (DECL_COMDAT_GROUP): New. (DECL_ONE_ONLY): Use DECL_COMDAT_GROUP. (tree_decl_with_vis): Add comdat_group. Remove one_only. (make_decl_one_only): Change signature. * varasm.c (get_emutls_init_templ_addr, emutls_decl): Update call to make_decl_one_only. (make_decl_one_only): Change signature. (default_elf_asm_named_section): Use DECL_COMDAT_GROUP. 2009-06-15 Rafael Avila de Espindola <espindola@google.com> * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove. * cp-tree.h (cxx_comdat_group): Change signature. * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP. (cxx_comdat_group): Change signature. * decl2.c (comdat_linkage, maybe_make_one_only): Update call to make_decl_one_only. (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP. * method.c (use_thunk): Update call to make_decl_one_only. * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP 2009-06-15 Rafael Avila de Espindola <espindola@google.com> * g++.dg/abi/mangle11.C: Update warning line. * g++.dg/abi/mangle12.C: Update warning line. * g++.dg/abi/mangle17.C: Update warning line. * g++.dg/abi/mangle20-2.C: Update warning line. From-SVN: r148492
2009-06-12java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt.Aldy Hernandez19-164/+310
gcc/java/ * java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt. * expr.c (force_evaluation_order): Same. * typeck.c: Add location to build_decl or PUSH_FIELD calls. * class.c: Same. * decl.c: Same. * jcf-parse.c: Same. * constants.c: Same. * resource.c: Same. * except.c: Same. * builtins.c: Same. * expr.c: Same. * java-tree.h (PUSH_FIELD): Add location field. gcc/objc/ * objc-act.c (finish_var_decl): Pass location to finish_decl. (objc_get_parm_info): Same. (get_super_receiver): Same. * objc-act.c (objc_build_component_ref): Pass location to build_compound_ref. (build_module_initializer_routine): Pass location to c_end_compound_stmt. (objc_generate_static_init_call): Pass location to build_stmt. (build_typed_selector_reference): New location argument. (build_selector_reference): Same. (objc_substitute_decl): Pass location to build_array_ref. (next_sjlj_build_try_catch_finally): Pass location to build_stmt. (objc_begin_catch_clause): Same. (objc_finish_try_stmt): Same. (objc_finish_catch_clause): Pass location to c_end_compound_stmt. (objc_build_throw_stmt): New argument. (generate_shared_structures): Pass location to build_c_cast. (objc_build_message_expr): Use local location. (objc_finish_message_expr): Use input_location. (build_objc_method_call): New argument. (objc_build_selector_expr): Same. (get_super_receiver): Pass location to build_c_cast, build_modify_expr, build_compound_expr. * objc-act.c: Add location to all calls to start_struct, build_decl, finish_struct. gcc/ * tree-pretty-print.c (dump_generic_node): Dump column numbers. * gimple-pretty-print.c (dump_gimple_stmt): Same. * gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs created. * c-parser.c (c_parser_binary_expression): Use current column while building binary operations. * common.opt (fshow-column): Enable by default. * tree-vrp.c (check_array_ref): Use warning_at. (check_array_bounds): Use location from call back if expr has no location. * tree.h: Add location argument to maybe_fold_*. * tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*. (maybe_fold_offset_to_array_ref): Add location argument and use it. (maybe_fold_offset_to_component_ref): Same. (maybe_fold_offset_to_reference): Same. (maybe_fold_offset_to_address): Same. (maybe_fold_stmt_indirect): Same. (maybe_fold_stmt_addition): Same. (fold_stmt_r): Pass location to maybe_fold_*. (fold_gimple_assign): Same. * c-tree.h: Add location argument to finish_decl, default_function_array_conversion, store_init_value. * c-decl.c (define_label): Use error_at. (c_make_fname_decl): Pass location to finish_decl. (finish_decl): New location argument. (build_compound_literal): Pass location to store_init_value. (grokdeclarator): Pass location to finish_decl. (grokfield): Same. * c-typeck.c (array_to_pointer_conversion): New location argument. (function_to_pointer_conversion): Same. (default_function_array_conversion): Same. (parser_build_unary_op): Pass location to overflow_warning. (parser_build_binary_op): Same. Use warning_at. (build_unary_op): Pass location to array_to_pointer_conversion. (build_c_cast): Pass location to digest_init. (build_modify_expr): New location argument. (convert_for_assignment): Same. (store_init_value): Same. (digest_init): Same. (output_init_element): Pass location to digest_init and array_to_pointer_conversion. (c_finish_return): Pass location to convert_for_assignment. * gimplify.c (gimplify_conversion): Pass location to maybe_fold_offset_to_address. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location to maybe_fold_stmt_addition. * c-omp.c (c_finish_omp_atomic): Pass new location to build_modify_expr. (c_finish_omp_for): Same. * c-common.c (overflow_warning): New argument. * c-common.h: New argument to build_modify_expr, overflow_warning. * c-parser.c (c_parser_declaration_or_fndef): Pass location to finish_decl. (c_parser_initializer): Pass location to default_function_array_conversion. (c_parser_initelt): Same. (c_parser_initval): Same. (c_parser_asm_operands): Same. (c_parser_expr_no_commas): Same. Pass location to build_modify_expr. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Add location info to stack. Use it. (c_parser_unary_expression): Pass location to default_function_array_conversion, parser_build_unary_op, build_indirect_ref, c_parser_postfix_expression_after_primary. (c_parser_postfix_expression_after_primary): New location argument. Use it. (c_parser_expression_conv): Pass location to default_function_array_conversion. (c_parser_expr_list): Same. (c_parser_omp_atomic): Same. (c_parser_omp_for_loop): Same. * c-tree.h: (struct c_declarator): Add comment to id_loc. (build_array_declarator): New argument. * c-decl.c (build_array_declarator): Add location argument. (grokdeclarator): Set id_loc for cdk_array. * c-parser.c (c_parser_direct_declarator_inner): Pass location to build_array_declarator. * tree.c (build_omp_clause): Add location argument. * tree.h (OMP_CLAUSE_HAS_LOCATION): New macro. (OMP_CLAUSE_LOCATION): New macro. (struct tree_omp_clause): Add location field. (build_omp_clause): Add argument. * testsuite/gcc.dg/gomp/for-1.c: Fix column. * cp/pt.c (tsubst_omp_for_iterator): Pass location to build_omp_clause. * cp/parser.c (cp_parser_omp_var_list_no_open): Same. (cp_parser_omp_clause_collapse): Same. (cp_parser_omp_clause_default): Same. (cp_parser_omp_clause_if): Same. (cp_parser_omp_clause_nowait): Same. (cp_parser_omp_clause_num_threads): Same. (cp_parser_omp_clause_ordered): Same. (cp_parser_omp_clause_schedule): Same. (cp_parser_omp_clause_untied): Same. (cp_parser_omp_for_loop): Same. (cp_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (c_start_case): Add location argument. (c_process_expr_stmt): Same. (c_finish_goto_*): Same. * tree-parloops.c (initialize_reductions): Pass location to build_omp_clause. (create_parallel_loop): Same. * fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same. (gfc_trans_omp_reduction_list): Same. (gfc_trans_omp_clauses): Same. (gfc_trans_omp_do): Same. * c-typeck.c (c_finish_goto_label): Same. (c_finish_goto_ptr): New location argument. (c_start_case): Same. (emit_side_effect_warnings): Same. (c_process_expr_stmt): Same. (c_finish_stmt_expr): Same. (c_finish_omp_clauses): Use error_at instead of error. * gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to build_omp_clause. * c-omp.c (c_split_parallel_clauses): New location argument. * tree-nested.c (convert_nonlocal_reference_stmt): Pass location to build_omp_clause. (convert_local_reference_stmt): Same. (convert_gimple_call): Same. * c-common.h (c_split_parallel_clauses): New argument. * c-parser.c (c_parser_statement_after_labels): Pass location to c_finish_goto_label. (c_parser_switch_statement): Pass location to c_start_case. (c_parser_for_statement): Pass location to c_finish_expr_stmt, and c_process_expr_stmt. (c_parser_omp_variable_list): Add location argument. (c_parser_omp_clause_collapse): Pass location to build_omp_clause. (c_parser_omp_clause_default): Same. (c_parser_omp_clause_if): Same. (c_parser_omp_clause_num_threads): Same. (-c_parser_omp_clause_ordered): Same. (c_parser_omp_clause_reduction): Pass location to c_parser_omp_variable_list. (c_parser_omp_clause_schedule): Pass location to build_omp_clause. (c_parser_omp_clause_untied): Same. (c_parser_omp_for_loop): Pass location to c_process_expr_stmt. (c_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (check_for_loop_decls, undeclared_variable, build_component_ref, build_array_ref, build_external_ref, c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op, build_conditional_expr, build_compound_expr, c_cast_expr, build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr, c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New argument. * c-semantics.c (build_stmt): Same. (build_case_label): Same. * c-decl.c (c_finish_incomplete_decl): Pass location on down. (undeclared_variable): New argument. (make_label): Same. (lookup_label): Pass location on down. (define_label): Same. (finish_decl): Same. (build_compound_literal): Same. (finish_struct): Same. (finish_function): Do not set location here. (check_for_loop_decls): New argument. * tree.c (save_expr): Set location. (build_empty_stmt): New argument. * tree.h (build_empty_stmt): New argument to build_empty_stmt. (CAN_HAVE_LOCATION_P): Make sure we have a non empty node. * builtins.c (gimplify_va_arg_expr): Use locations. (expand_builtin_sync_operation): Same. * c-typeck.c (build_component_ref): New argument. (build_array_ref): Same. (build_external_ref): Same. (c_expr_sizeof_expr): Same. (c_expr_sizeof_type): Same. (parser_build_unary_op): Same. (build_conditional_expr): Same. (build_compound_expr): Pass location on down. (build_compound_expr): New argument. (build_c_cast): Same. (c_cast_expr): Same. (build_asm_expr): Same. (c_finish_return): Same. (c_process_expr_stmt): Pass location on down. (c_finish_stmt_expr): New argument. (push_clenaup): Same. (c_finish_omp_parallel): Same. (c_finish_omp_task): Same. * gimplify.c (gimplify_call_expr): Pass location on down. * c-omp.c (c_finish_omp_master): New argument. (c_finish_omp_critical): Same. (c_finish_omp_ordered): Same. (c_finish_omp_barrier): Same. (-c_finish_omp_taskwait): Same. (c_finish_omp_atomic): Same. (c_finish_omp_flush): Same. * tree-inline.c (copy_tree_body_r): Pass location on down. (inline_forbidden_p): Remove use of input_location. * c-gimplify.c (c_build_bind_expr): New argument. * c-common.c (c_common_truthvalue_conversion): Pass location on down. (c_sizeof_or_alignof_type): New argument. (c_alignof_expr): Same. (build_va_arg): Same. (c_add_case_label): Same. * c-common.h (c_sizeof_or_alignof_type, c_alignof_expr, c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label, c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses): New argument. * stub-objc.c (objc_build_selector_expr): Same. (objc_build_throw_stmt): Same. * c-parser.c (c_parser_declaration_or_fndef): Pass location on down. (c_parser_initelt): Same. (c_parser_compound_statement): Same. (c_parser_compound_statement_nostart): Same. (c_parser_label): Same. (c_parser_statement_after_labels): Same. (c_parser_if_body): Same. (c_parser_else_body): Same. (c_parser_if_statement): Same. (c_parser_switch_statement): Same. (c_parser_while_statement): Same. (c_parser_do_statement): Same. (c_parser_for_statement): Same. (c_parser_asm_statement): Same. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Same. (c_parser_cast_expression): Same. (c_parser_unary_expression): Same. (c_parser_sizeof_expression): Same. (c_parser_alignof_expression): Same. (c_parser_postfix_expression): Same. (c_parser_expression): Same. (c_parser_objc_receiver): Same. (c_parser_omp_variable_list): Same. (c_parser_omp_structured_block): Same. (c_parser_omp_atomic): New argument. (c_parser_omp_barrier): Same. (c_parser_omp_critical): Same. (c_parser_omp_flush): Pass location on down. (c_parser_omp_for_loop): New argument. (c_parser_omp_for): Same. (c_parser_omp_master): Same. (c_parser_omp_ordered): Same. (c_parser_omp_sections_scope): Same. (c_parser_omp_sections): Same. (c_parser_omp_parallel): Same. (c_parser_omp_single): Same. (c_parser_omp_task): Same. (c_parser_omp_taskwait): Pass location on down. (c_parser_omp_construct): Same. (c_parser_omp_threadprivate): Same. * dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h, builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c, tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c, c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c, c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c, emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c, rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h, tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c, config/i386/i386.c, stmt.c: Add location argument to the following function definitions and/or function calls: build_decl, objcp_start_struct, objcp_finish_struct, start_struct, finish_struct, PUSH_FIELD, create_artificial_label, cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl, build_compound_literal, parser_xref_tag, resolve_overloaded_builtin, do_case, c_finish_bc_stmt, build_compound_literal, build_function_call. * c-decl.c (build_compound_literal): Add location argument. Make all diagnostic calls use location. (start_struct): Same. (finish_struct): Same. (start_enum): Same. (build_enumerator): Same. (start_function): Same. (grokdeclarator): Make all diagnostic calls use location. (store_parm_decls_oldstyle): Same. * c-typeck.c (build_function_call): Add location argument. Make all diagnostic calls use location. (do_case): Same. (c_finish_bc_stmt): Same. * tree-nested.c (get_trampoline_type): Add argument. Pass location to build_decl. (lookup_tramp_for_decl): Pass location to get_trampoline_type. * rtl.h (RTL_LOCATION): New. * c-common.c (c_add_case_label): Add location argument. Make all diagnostic calls use location. * c-common.h: Add location argument to make_fname_decl, do_case, c_add_case_label, build_function_call, resolve_overloaded_builtin. * c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc. Set it appropriately for every case. Pass enum_loc to start_enum call. Pass value_loc first to build_enumerator. Pass enum_loc to parser_xref_tag. (c_parser_struct_or_union_specifier): Save location. Use it for start_struct, finish_struct, and parser_xref_tag. gcc/testsuite/ * gcc.dg/old-style-prom-3.c: Add column info. * gcc.dg/overflow-warn-1.c * gcc.dg/gomp/pr27415.c * gcc.dg/gomp/for-1.c: Same. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/c99-tag-3.c: Same. * gcc.dg/Wredundant-decls-2.c: Same. * gcc.dg/func-ptr-conv-1.c: Same. * gcc.dg/asm-wide-1.c: Same. * gcc.dg/nofixed-point-2.c: Same. * gcc.dg/cpp/line3.c: Same. * gcc.dg/array-10.c: Same. * gcc.dg/c99-vla-jump-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/Wshadow-3.c: Same. * gcc.dg/c90-const-expr-8.c: Same. * gcc.dg/label-decl-2.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/c90-const-expr-5.c: Same. * gcc.dg/builtins-30.c: Same. * gcc.dg/Warray-bounds.c: Same. * gcc.dg/Wcxx-compat-2.c: Same. * gcc.dg/tree-ssa/col-1.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/cast-function-1.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/vla-8.c: Same. * gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct line. * gcc.dg/label-decl-2.c: Move label diagnostic to correct line. * gcc.dg/old-style-prom-3.c: Check for error on the correct line. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/builtins-30.c: Same. Test for columns. gcc/objcp/ * objcp-decl.h (c_end_compound_stmt): New argument. * objcp-decl.c (objcp_start_struct): Add argument. (objcp_finish_struct): Same. gcc/cp/ * typeck.c (cp_build_binary_op): Pass location to overflow_warning. (build_modify_expr): New arg. * semantics.c (finish_unary_op_expr): Pass location to overflow_warning. (handle_omp_for_class_iterator): Pass location to build_modify_expr. * typeck.c (cxx_sizeof_or_alignof_type): Pass location to c_sizeof_or_alignof_type. (build_array_ref): New argument. (build_compound_expr): Same. (build_const_cast): Same. (build_ptrmemfunc): Pass location to build_c_cast. * init.c (avoid_placement_new_aliasing): Pass location to build_stmt. (build_vec_delete_1): Pass location to cp_build_modify_expr, build_compound_expr. * class.c (build_vtbl_ref_1): Pass location to build_array_ref. * decl.c (poplevel): Pass location to c_build_bind_expr. (finish_case_label): Pass location to build_case_label. (finish_constructor_body): Same. (finish_destructor_body): Pass location to build_stmt. (cxx_maybe_build_cleanup): Same, but to build_compound_expr. * call.c (build_new_op): Pass location to build_array_ref. (build_x_va_arg): Pass location to build_va_arg. * except.c (expand_end_catch_block): Pass location to build_stmt. * cp-tree.h (build_array_ref): New argument. (build_compound_expr): Same. (build_c_cast): Same. * cp-gimplify.c (gimplify_if_stmt): Pass location on down. (gimplify_switch_stmt): Same. * typeck2.c (split_nonconstant_init_1): Same. * pt.c (tsubst_copy): Same. * semantics.c (add_decl_expr): Same. (do_poplevel): Same. (push_cleanup): Same. (finish_goto_stmt): Same. (finish_expr_stmt): Same. (begin_if_stmt): Same. (begin_while_stmt): Same. (begin_do_stmt): Same. (finish_return_stmt): Same. (begin_for_stmt): Same. (finish_break_stmt): Same. (finish_continue_stmt): Same. (begin_switch_stmt): Same. (begin_try_block): Same. (begin_handler): Same. (finish_asm_stmt): Same. (finish_label_stmt): Same. (finish_stmt_expr_expr): Same. (finalize_nrv_r): Same. (finish_omp_atomic): Same. * name-lookup.c (do_using_directive): Same. * decl2.c (grok_array_decl): Same. * parser.c (cp_parser_cast_expression): Same. (cp_parser_selection_statement): Same. (cp_parser_implicitly_scoped_statement): Same. (cp_parser_objc_selector_expression): Same. (cp_parser_objc_synchronized_statement): Same. (cp_parser_objc_throw_statement): Same. (cp_parser_omp_critical): Same. (cp_parser_omp_master): Same. * typeck.c (build_function_call): Add location argument. * init.c: Add location argument to all build_decl calls. * class.c: Same. * method.c: Same. * rtti.c: Same. * tree.c: Same. * pt.c: Same. * semantics.c: Same. * lex.c: Same. * decl2.c: Same. * cp-gimplify.c: Same. * decl.c: Same. (cp_make_fname_decl): Add location argument. Pass location ot build_decl. (finish_case_label): Same. * cp-tree.h (finish_case_label): Add location argument. * parser.c (cp_parser_label_for_labeled_statement): Pass location to finish_case_label. gcc/fortran/ * trans-array.c (gfc_trans_allocate_array_storage): Pass location on down. (gfc_trans_array_constructor_value): Same. (gfc_trans_scalarized_loop_end): Same. (gfc_conv_ss_startstride): Same. (gfc_trans_g77_array): Same. (gfc_trans_dummy_array_bias): Same. (gfc_conv_array_parameter): Same. (structure_alloc_comps): Same. * trans-expr.c (gfc_conv_function_call): Same. (fill_with_spaces): Same. (gfc_trans_string_copy): Same. (gfc_trans_scalar_assign): Same. * trans-stmt.c (gfc_trans_goto): Same. (gfc_trans_if_1): Same. (gfc_trans_simple_do): Same. (gfc_trans_do): Same. (gfc_trans_do_while): Same. (gfc_trans_logical_select): Same. (gfc_trans_select): Same. (gfc_trans_forall_loop): Same. (gfc_trans_nested_forall_loop): Same. (generate_loop_for_temp_to_lhs): Same. (generate_loop_for_rhs_to_temp): Same. (gfc_trans_forall_1): Same. (gfc_trans_where_assign): Same. (gfc_trans_where_3): Same. (gfc_trans_allocate): Same. * trans.c (gfc_finish_block): Same. (gfc_trans_runtime_check): Same. (gfc_call_malloc): Same. (gfc_allocate_with_status): Same. (gfc_call_free): Same. (gfc_deallocate_with_status): Same. (gfc_call_realloc): Same. (gfc_trans_code): Same. * trans-decl.c (gfc_init_default_dt): Same. (gfc_generate_constructors): Same. * trans-io.c (gfc_trans_io_runtime_check): Same. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same. (gfc_conv_intrinsic_fdate): Same. (gfc_conv_intrinsic_ttynam): Same. (gfc_conv_intrinsic_minmax): Same. (gfc_conv_intrinsic_minmax_char): Same. (gfc_conv_intrinsic_anyall): Same. (gfc_conv_intrinsic_count): Same. (gfc_conv_intrinsic_arith): Same. (gfc_conv_intrinsic_minmaxloc): Same. (gfc_conv_intrinsic_minmaxval): Same. (gfc_conv_intrinsic_rrspacing): Same. (gfc_conv_intrinsic_array_transfer): Same. (gfc_conv_intrinsic_trim): Same. (gfc_conv_intrinsic_repeat): Same. From-SVN: r148442
2009-06-09re PR c++/40381 (Revision 142379 caused ICE with deleted functions)Jason Merrill2-0/+6
PR c++/40381 * decl2.c (mark_used): Return after complaining about deleted fn. From-SVN: r148319
2009-06-09parser.c (cp_parser_type_id_1): 'auto' type is ok with a late-specified ↵Jason Merrill2-2/+16
return type. * parser.c (cp_parser_type_id_1): 'auto' type is ok with a late-specified return type. From-SVN: r148306
2009-06-08re PR c++/40373 (ICE with invalid destructor call)Jakub Jelinek2-1/+5
PR c++/40373 * call.c (check_dtor_name): Return false even if get_type_value (name) is error_mark_node. * g++.dg/template/dtor7.C: New test. From-SVN: r148282
2009-06-08re PR c++/40370 (ICE with invalid array bound in template class)Jakub Jelinek2-7/+15
PR c++/40370 PR c++/40372 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS on error_mark_node. Check for VLAs outside of function context before check whether to wrap bounds into a NOP_EXPR with TREE_SIDE_EFFECTS. * g++.dg/template/error41.C: New test. * g++.dg/template/error42.C: New test. From-SVN: r148278