aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
AgeCommit message (Collapse)AuthorFilesLines
2010-06-01Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.Arnaud Charlet1-1/+85
* Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o. * decl2.c: Include langhooks.h and c-ada-spec.h. (cpp_check, collect_source_refs, collect_ada_namespace, collect_all_refs): New functions. (cp_write_global_declarations): Add handling of -fdump-ada-spec. * lang-specs.h: Ditto. Co-Authored-By: Matthew Gingell <gingell@adacore.com> From-SVN: r160103
2010-05-30cp-tree.h (cp_build_function_call_nary): Declare.Nathan Froyd1-9/+9
* cp-tree.h (cp_build_function_call_nary): Declare. * typeck.c (cp_build_function_call_nary): Define. * decl.c (register_dtor_fn): Use it instead of cp_build_function_call. (cxx_maybe_build_cleanup): Likewise. * decl2.c (generate_ctor_or_dtor_function): Likewise. * except.c (do_get_exception_ptr): Likewise. (do_begin_catch): Likewise. (do_allocate_exception): Likewise. (do_free_exception): Likewise. (build_throw): Likewise. Use cp_build_function_call_vec instead of cp_build_function_call. (do_end_catch): Likewise. From-SVN: r160045
2010-05-25Makefile.in (EXCEPT_H): Fix typo.Steven Bosscher1-2/+1
gcc/ChangeLog: * Makefile.in (EXCEPT_H): Fix typo. objc/ChangeLog: * objc-act.h: Do not include gimple.h. * objc-act.c: Do not include rtl.h, expr.h, libfuncs.h, and tm_p.h. Include gimple.h. Explain why except.h has to be included. * objc-lang.c: Do not include diagnostics.h. * Make-lang.in: Update dependencies. objcp/ChangeLog: * objcp-decl.c: Do not include tm.h, rtl.h, expr.h, c-common.h, flags.h, input.h, except.h, output.h, toplev.h, cpplib.h, debug.h, and target.h. * objcp-lang.c: Do not include tm.h, toplev.h, diagnostics.h, and debug.h. Explain why except.h has to be included. * Make-lang.in: Update dependencies. cp/ChangeLog: * cp-tree.h: Do not include splay-tree.h. (struct prtmem_cst): Remove unused field and false comment. * typeck.c: Do not include rtl.h, expr.h, and tm_p.h. * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h. * init.c: Do not include rtl.h and expr.h. * class.c: Do not include rtl.h. Include splay-tree.h. (build_clone): Use plain NULL instead of NULL_RTX. * decl.c: Do not include expr.h. Explain why rtl.h has to be included. Include splay-tree.h. * method.c: Do not include rtl.h and expr.h. (use_thunk): Use plain NULL instead of NULL_RTX. * except.c: Do not include rtl.h, expr.h, and libfuncs.h. * tree.c: Do not include rtl.h, insn-config.h, integrate.h, and target.h. Include splay-tree.h. * expr.c: Do not include rtl.h and expr.h. * pt.c: Do not include obstack.h and rtl.h. (tsubst_friend_function): Use plain NULL instead of NULL_RTX. (tsubst_decl): Likewise. (instantiate_decl): Likewise. * semantics.c: Do not include exprt.h and debug.h. Explain why rtl.h has to be included. * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h. * call.c: Do not include rtl.h and expr.h. * search.c: Do not include obstack.h and rtl.h. * friend.c: Do not include rtl.h and expr.h. * Make-lang.in: Update dependencies. From-SVN: r159839
2010-05-22decl2.c (maybe_emit_vtables): Produce same comdat group when outputting ↵Jan Hubicka1-13/+16
comdat vtables. * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting comdat vtables. (cxx_callgraph_analyze_expr): Remove code marking vtables needed. * cgraph.h (struct varpool_node): Add same_comdat_group. * lto-cgrpah.c (lto_output_varpool_node): Output same_comdat_group pointer. (output_varpool): Update call of lto_output_varpool_node. (input_varpool): Read same_comdat_group pointer. (input_varpool_1): Fixup same_comdat_group pointer. * ipa.c (cgraph_remove_unreachable_nodes): WHen one of same comdat group is needed, all are. * varpool.c (varpool_remove_node): Remove node from same comdat group linklist too. (varpool_analyze_pending_decls): Walk same comdat groups. From-SVN: r159699
2010-05-19call.c (reference_binding): Use cp_build_qualified_type_real and ↵Jason Merrill1-1/+1
cp_type_quals consistently. * call.c (reference_binding): Use cp_build_qualified_type_real and cp_type_quals consistently. (add_function_candidate): Likewise. (build_conditional_expr): Likewise. (convert_like_real): Likewise. (type_passed_as): Likewise. * class.c (add_method): Likewise. (same_signature_p): Likewise. (layout_class_type): Likewise. * decl.c (cxx_init_decl_processing): Likewise. (cp_fname_init): Likewise. (grokdeclarator): Likewise. * decl2.c (cp_reconstruct_complex_type): Likewise. * init.c (build_new_1): Likewise. * method.c (do_build_copy_constructor): Likewise. (implicitly_declare_fn): Likewise. * pt.c (tsubst_aggr_type): Likewise. (tsubst): Likewise. * rtti.c (init_rtti_processing): Likewise. (build_headof): Likewise. (build_dynamic_cast_1): Likewise. (tinfo_base_init): Likewise. (emit_support_tinfos): Likewise. * semantics.c (capture_decltype): Likewise. * tree.c (cv_unqualified): Likewise. * typeck.c (composite_pointer_type): Likewise. (string_conv_p): Likewise. * mangle.c (write_CV_qualifiers_for_type): Tweak. * call.c (initialize_reference): Use CP_TYPE_CONST_P. * decl.c (start_decl): Likewise. * semantics.c (finish_compound_literal): Likewise. * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P. (cp_type_readonly): Remove. * cp-tree.h: Remove declaration. From-SVN: r159599
2010-05-19re PR c++/44193 (function types, cv-quals and typename)Jason Merrill1-1/+5
PR c++/44193 * typeck.c (type_memfn_quals): New fn. (apply_memfn_quals): New fn. (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE. (cp_type_readonly): Use cp_type_quals. * cp-tree.h: Add declarations. * tree.c (cp_build_qualified_type_real): Don't set, but do preserve, quals on FUNCTION_TYPE. (strip_typedefs): Use apply_memfn_quals and type_memfn_quals. * decl.c (build_ptrmem_type): Likewise. (grokdeclarator): Likewise. (static_fn_type): Likewise. * decl2.c (change_return_type): Likewise. (cp_reconstruct_complex_type): Likewise. * pt.c (tsubst_function_type): Likewise. (unify): Likewise. (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code. From-SVN: r159596
2010-05-13typeck.c (cp_build_array_ref): Factor out from...Jason Merrill1-2/+1
* typeck.c (cp_build_array_ref): Factor out from... (build_array_ref): ...here. Drop complain parm. (build_new_op): Adjust. * class.c (build_vtbl_ref_1): Adjust. * decl2.c (grok_array_decl): Adjust. * cp-tree.h: Adjust prototypes. From-SVN: r159377
2010-05-13typeck.c (build_array_ref): Take complain parm.Jason Merrill1-1/+2
* typeck.c (build_array_ref): Take complain parm. * cp-tree.h: Add it to prototype. * call.c (build_new_op): Pass it. * class.c (build_vtbl_ref): Pass it. * decl2.c (grok_array_decl): Pass it. From-SVN: r159351
2010-04-07PR c++/11094, DR 408Jason Merrill1-0/+4
PR c++/11094, DR 408 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New. * decl2.c (finish_static_data_member_decl): Set it. * decl.c (duplicate_decls): Propagate it. * pt.c (tsubst_decl): Don't substitute the domain of an array VAR_DECL if it's set. (regenerate_decl_from_template): Substitute it here. (type_dependent_expression_p): Return true if it's set. * semantics.c (finish_decltype_type): Instantiate such a variable. * typeck.c (cxx_sizeof_expr): Likewise. (strip_array_domain): New. From-SVN: r158075
2010-03-23Make lambda conversion op and op() non-static.Jason Merrill1-2/+15
* semantics.c (maybe_add_lambda_conv_op): Make non-static. Also add the thunk function returned by the conversion op. Mark the conversion deleted if the op() is variadic. * decl2.c (mark_used): Give helpful message about deleted conversion. * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static. * semantics.c (finish_this_expr): Adjust. * mangle.c (write_closure_type_name): Adjust. * decl.c (grok_op_properties): Don't allow it. * call.c (build_user_type_conversion_1): No static conversion ops. (build_op_call): Or op(). * decl2.c (change_return_type): Fix 'this' quals. From-SVN: r157681
2010-03-20re PR c++/43081 (ICE with invalid in-class initializer)Simon Martin1-2/+7
gcc/cp/ 2010-03-20 Simon Martin <simartin@users.sourceforge.net> PR c++/43081: * decl2.c (grokfield): Handle invalid initializers for member functions. gcc/testsuite/ 2010-03-20 Simon Martin <simartin@users.sourceforge.net> Michael Matz <matz@suse.de> PR c++/43081 * g++.dg/parse/crash56.C: New test. Co-Authored-By: Michael Matz <matz@suse.de> From-SVN: r157597
2010-03-20re PR c++/43375 (ICE during compiling SSE code)Dodji Seketeli1-1/+2
Fix for PR c++/43375 gcc/cp/ChangeLog: PR c++/43375 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC is NULL. * decl2.c (vague_linkage_p): Likewise. gcc/testsuite/g++.dg/ChangeLog: PR c++/43375 * g++.dg/abi/mangle42.C: New test. From-SVN: r157590
2010-03-03re PR c++/12909 (ambiguity in mangling vector types)Jason Merrill1-8/+9
PR c++/12909 * method.c (make_alias_for): Handle VAR_DECL, too. * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p. * tree.c (no_linkage_check): Adjust. * decl.c (maybe_commonize_var): Adjust. * mangle.c (mangle_decl): Adjust. * cp-tree.h: Adjust. From-SVN: r157202
2010-02-09re PR c++/42370 ([C++0x][lambda] in a void function: "Warning: control ↵Jason Merrill1-0/+27
reaches end of non-void function") PR c++/42370 * decl2.c (change_return_type): New fn. * semantics.c (apply_lambda_return_type): Use it. * cp-tree.h: Declare it. From-SVN: r156634
2009-12-11re PR c++/42225 (GCC 4.5 ICE (segfault) on C++ templated code)Dodji Seketeli1-1/+1
Fix PR c++/42225 gcc/cp/ChangeLog: PR c++/42225 * typeck.c (incompatible_dependent_typedefs_p): New function. (structural_comptypes): Use it. * cp-tree.h (cp_set_underlying_type): Declare ... * tree.c (cp_set_underlying_type): ... new function. * class.c (build_self_reference): Use cp_set_underlying_type instead of set_underlying_type. * decl2.c (grokfield): Likewise. * name-lookup.c (pushdecl_maybe_friend): Likewise. gcc/testsuite/ChangeLog: PR c++/42225 * g++.dg/template/typedef24.C: New test. * g++.dg/template/typedef25.C: New test. From-SVN: r155160
2009-12-10re PR c++/42317 (Issues with comdat virtual dtors)Jakub Jelinek1-1/+18
PR c++/42317 * cgraph.h (struct cgraph_node): Add same_comdat_group field. * cgraph.c (cgraph_remove_node): Unchain node from same_comdat_group circular list. (cgraph_node_can_be_local_p): Return false for DECL_COMDAT with node->same_comdat_group. * ipa.c (cgraph_remove_unreachable_nodes): For any reachable node mark all its same_comdat_group nodes as also reachable. (cgraph_externally_visible_p): Return true even if any of same_comdat_group nodes has address taken. * lto-cgraph.c (lto_output_node): Stream out same_comdat_group. (output_cgraph): Ensure other same_comdat_group nodes are also included. (input_node): Stream in same_comdat_group. (input_cgraph_1): Fix up same_comdat_group fields from references to pointers. * cgraphunit.c (cgraph_analyze_functions): Mark all other same_comdat_group nodes as reachable. (cgraph_mark_functions_to_output): For each node->process process also other same_comdat_group nodes. * ipa-inline.c (cgraph_clone_inlined_nodes): Don't reuse nodes with same_comdat_group non-NULL. (cgraph_mark_inline_edge): Likewise. * decl2.c (cp_write_global_declarations): Clear DECL_EXTERNAL also on all other functions in the same comdat group. * optimize.c (maybe_clone_body): Also optimize virtual implicit dtors. For virtual comdat dtors tell cgraph that base and deleting dtor are in the same comdat group. * config/abi/pre/gnu.ver: Don't export certain base dtors that weren't previously exported. * g++.dg/opt/dtor2.C: New test. * g++.dg/opt/dtor2.h: New file. * g++.dg/opt/dtor2-aux.cc: New file. From-SVN: r155143
2009-12-03re PR middle-end/41611 (guard variable is emitted even when the guarded ↵Jason Merrill1-1/+2
symbol isn't) PR c++/41611 * decl2.c (get_guard): Don't use the same comdat group as the decl. From-SVN: r154965
2009-12-01re PR middle-end/41611 (guard variable is emitted even when the guarded ↵Jason Merrill1-2/+2
symbol isn't) PR c++/41611 * decl2.c (get_guard): Copy DECL_COMDAT. (comdat_linkage): Set DECL_COMDAT unconditionally. From-SVN: r154885
2009-11-18re PR c++/3187 (gcc lays down two copies of constructors)Jakub Jelinek1-1/+13
PR c++/3187 * cgraph.h (struct cgraph_node): Add same_body and same_body_alias fields. (cgraph_same_body_alias, cgraph_remove_same_body_alias): New prototypes. * cgraphunit.c (cgraph_expand_function, cgraph_emit_thunks, cgraph_materialize_all_clones): Handle same_body aliases. * cgraph.c (cgraph_allocate_node): New function. (cgraph_create_node): Use it. (cgraph_node_for_decl, cgraph_node, cgraph_get_node, cgraph_node_for_asm, cgraph_remove_node): Handle same_body aliases. (cgraph_same_body_alias, cgraph_remove_same_body_alias): New functions. * lto-cgraph.c (lto_output_node): Stream out same_body aliases. (input_node): Stream in same_body aliases. * lto-symtab.c (lto_cgraph_replace_node): Clear node pointers for same_body aliases. (lto_symtab_merge_cgraph_nodes_1): Handle same_body aliases. * cp-tree.h (expand_or_defer_fn_1): New prototype. * decl2.c (cp_write_global_declarations): Mark as !DECL_EXTERNAL also all same_body aliases. * semantics.c (expand_or_defer_fn): Move most of the function except registering with cgraph to ... (expand_or_defer_fn_1): ... here. New function. * optimize.c: Include cgraph.h. (maybe_clone_body): If in charge parm is not used and both base and complete clones are created and are not comdat, tell cgraph they have the same body. * Make-lang.in (cp/optimize.o): Depend on $(CGRAPH_H). * g++.dg/abi/mangle26.C: Also match *C2* definition. * g++.dg/abi/mangle27.C: Likewise. * g++.dg/abi/mangle28.C: Likewise. * g++.dg/abi/mangle29.C: Likewise. From-SVN: r154284
2009-11-12re PR c++/39560 (Erroneous warnings 'unused variable' in a templated class ↵Jason Merrill1-0/+1
method with union) PR c++/39560 * decl2.c (build_anon_union_vars): Set DECL_ARTIFICIAL. From-SVN: r154133
2009-11-12decl2.c (constrain_visibility): Clear WEAK and COMMON flags.Jan Hubicka1-0/+2
* decl2.c (constrain_visibility): Clear WEAK and COMMON flags. * ipa.c (function_and_variable_visibility): Verify that WEAK || COMMON imply PUBLIC || EXTERNAL. From-SVN: r154115
2009-11-07re PR c++/18451 (C++ error message regression)Jason Merrill1-1/+1
PR c++/18451 PR c++/40738 * cp-tree.h (cp_decl_specifier_seq): Add any_type_specifiers_p. * parser.c (cp_parser_single_declaration): Call cp_parser_parse_and_diagnose_invalid_type_name here, too. (cp_parser_parameter_declaration): And here. (cp_parser_parse_and_diagnose_invalid_type_name): Be less picky about declarator form. Don't skip to the end of the block if we're in a declarator. (cp_parser_decl_specifier_seq): Set any_type_specifiers_p. (cp_parser_simple_declaration): Check it. (cp_parser_member_declaration): Likewise. (cp_parser_diagnose_invalid_type_name): Tweak error message. (cp_parser_expression_statement): Likewise. * decl2.c (grokfield): Mention decltype instead of typeof. From-SVN: r154006
2009-11-06re PR c++/9381 (attribute on member function pointer have no effect)Jason Merrill1-1/+13
PR c++/9381 * decl2.c (build_memfn_type): Preserve attributes. (cp_reconstruct_complex_type): Likewise. (maybe_retrofit_in_chrg): Likewise. * call.c (standard_conversion): Use build_memfn_type. * pt.c (tsubst): Likewise. * decl.c (build_ptrmem_type): Likewise (check_function_type): Preserve attributes. * tree.c (cp_build_type_attribute_variant): Propagate exception specs on METHOD_TYPE, too. (strip_typedefs): Preserve exception specs and attributes. From-SVN: r153977
2009-11-03re PR c++/36959 (C++ front-end causing a static inline function to be emitted)Jason Merrill1-0/+1
PR c++/36959 * decl2.c (cxx_callgraph_analyze_expr): Don't reference a function just because a static variable in it is needed unless -frepo. From-SVN: r153878
2009-11-02Restrict DR 757 change to C++0x mode.Jason Merrill1-1/+2
* decl2.c (mark_used): Check cxx_dialect. * decl.c (grokfndecl): Do check type linkage in C++98 mode. (grokvardecl): Likewise. * pt.c (check_instantiated_arg): Likewise. From-SVN: r153816
2009-10-26PR c++/38796, Core issue 906Jason Merrill1-3/+1
PR c++/38796, Core issue 906 gcc/cp * cp-tree.h (DECL_DEFAULTED_OUTSIDE_CLASS_P): New. (DECL_DEFAULTED_IN_CLASS_P): New. * class.c (user_provided_p): Non-static. (check_methods): Use it. (check_bases_and_members): Check defaulted fns. (defaultable_fn_p): Move and rename to... * method.c (defaultable_fn_check): ...this. (defaulted_late_check): New. * pt.c (tsubst_decl): Call it. * decl2.c (grokfield): Adjust. * decl.c (cp_finish_decl): Adjust. (grok_special_member_properties): Use user_provided_p. libstdc++-v3 * include/std/future (~Future_result_base): Default outside class body. * include/std/system_error (error_category()): Likewise. * libsupc++/nested_exception.h (nested_exception): Remove exception specifications from defaulted methods. From-SVN: r153565
2009-09-18decl2.c (determine_visibility): Make anonymous types internal.Jason Merrill1-1/+27
* decl2.c (determine_visibility): Make anonymous types internal. (mark_used): Complain about types without linkage used in decls with internal linkage. (vague_linkage_fn_p): Split out from... * decl.c (maybe_commonize_var): ...here. (grokdeclarator): Adjust linkage when a typedef gives linkage name. * tree.c (no_linkage_check): Check the enclosing class and template arguments. * cp-tree.h (TYPE_NAMESPACE_SCOPE_P): New. From-SVN: r151868
2009-09-09re PR c++/28293 (ICE on invalid typedef)Paolo Carlini1-5/+16
/cp 2009-09-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/28293 * decl2.c (grokfield): Check for explicit template argument lists. /testsuite 2009-09-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/28293 * g++.dg/template/crash91.C: New. From-SVN: r151581
2009-09-08cp-tree.h (enum overload_flags): Remove OP_FLAG.Jason Merrill1-1/+1
* cp-tree.h (enum overload_flags): Remove OP_FLAG. * method.c (lazily_declare_fn): Check for dtorness in ABI warning. From-SVN: r151528
2009-09-03[multiple changes]Diego Novillo1-7/+49
2009-09-01 Diego Novillo <dnovillo@google.com> * c-lang.c (lang_hooks): Remove const qualifier. java/ChangeLog * lang.c (lang_hooks): Remove const qualifier. objc/ChangeLog * objc-lang.c (lang_hooks): Remove const qualifier. objcp/ChangeLog * objcp-lang.c (lang_hooks): Remove const qualifier. ada/ChangeLog * gcc-interface/misc.c (lang_hooks): Remove const qualifier. fortran/ChangeLog * f95-lang.c (lang_hooks): Remove const qualifier. cp/ChangeLog * cp-lang.c (lang_hooks): Remove const qualifier. 2009-09-01 Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_node_for_decl): New. * cgraph.h (cgraph_node_for_decl): Declare. * tree.c (host_integerp): Return 0 if T is NULL. 2009-09-01 Diego Novillo <dnovillo@google.com> * tree.h (struct alias_pair): Move from varasm.c. (alias_pairs): Likewise. (TYPE_MAXVAL): Define. (TYPE_MINVAL): Define. (iterative_hash_host_wide_int): Declare. (remove_unreachable_alias_pairs): Declare. * tree-pass.h (pass_ipa_free_lang_data): Declare. * diagnostic.c (default_diagnostic_starter): Make extern. (default_diagnostic_finalizer): Make extern. * diagnostic.h (default_diagnostic_starter): Declare. (default_diagnostic_finalizer): Declare. (default_tree_printer): Declare. * toplev.c (default_tree_printer): Make extern. 2009-09-01 Richard Guenther <rguenther@suse.de> Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_add_new_function): Remove gimplification. * cgraphunit.c (cgraph_expand_function): Do not emit associated thunks from here. (cgraph_emit_thunks): New. (cgraph_optimize): Call it. Return if any IPA pass finds an error. * varasm.c (finish_aliases_1): Ignore errorneous aliases used by thunks. 2009-09-01 Simon Baldwin <simonb@google.com> Rafael Espindola <espindola@google.com> Richard Guenther <rguenther@suse.de> Doug Kwan <dougkwan@google.com> Diego Novillo <dnovillo@google.com> * tree.c: Include tree-pass.h, langhooks-def.h, diagnostic.h, cgraph.h, timevar.h, except.h and debug.h. (free_lang_data_in_type): New. (need_assembler_name_p): New. (free_lang_data_in_block): New. (free_lang_data_in_decl): New. (struct free_lang_data_d): New. (add_tree_to_fld_list): New. (find_decls_types_r): New. (get_eh_types_for_runtime): New. (find_decls_types_in_eh_region): New. (find_decls_types_in_node): New. (find_decls_types_in_var): New. (free_lang_data_in_cgraph): New. (free_lang_data): New. (gate_free_lang_data): New. (pass_ipa_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * timevar.def (TV_IPA_FREE_LANG_DATA): Define. * langhooks.h (struct lang_hooks): Add field free_lang_data. (lang_hooks): Remove const qualifier. * ipa.c (cgraph_remove_unreachable_nodes): Call remove_unreachable_alias_pairs. * except.c (add_type_for_runtime): Check if TYPE has already been converted. (lookup_type_for_runtime): Likewise. (check_handled): Handle converted types. * varasm.c (remove_unreachable_alias_pairs): New. * gimple.c: Include demangle.h. (gimple_decl_printable_name): New. (gimple_fold_obj_type_ref): New. * gimple.h (gimple_decl_printable_name): Declare. (gimple_fold_obj_type_ref): Declare. * passes.c (init_optimization_passes): Add pass pass_ipa_free_lang_data. * langhooks-def.h (LANG_HOOKS_FREE_LANG_DATA): Define. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_FREE_LANG_DATA. testsuite/ChangeLog 2009-09-01 Diego Novillo <dnovillo@google.com> * gcc.dg/gomp/combined-1.c: Adjust expected pattern. * g++.dg/tree-prof/inline_mismatch_args.C: Likewise. * g++.dg/warn/unit-1.C: Likewise. * g++.dg/ipa/iinline-1.C: Likewise. * g++.dg/template/cond2.C: Adjust expected line location for the error. * g++.dg/template/pr35240.C: Likewise. cp/ChangeLog 2009-09-01 Doug Kwan <dougkwan@google.com> * tree.c (cp_fix_function_decl_p): New. (cp_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H). * decl2.c: Include pointer-set.h. (collect_candidates_for_java_method_aliases): New. (cp_write_global_declarations): Call it. Add local variable CANDIDATES. If set, call build_java_method_aliases. (build_java_method_aliases): Add argument CANDIDATES. Use it to determine if FNDECL should get a hidden alias. * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define. * cp-tree.h (cp_free_lang_data): Declare. 2009-09-03 Richard Guenther <rguenther@suse.de> * method.c (use_thunk): Use cgraph_finalize_function to hand off thunks to the cgraph. * semantics.c (emit_associated_thunks): Do not emit thunks for really extern functions. From-SVN: r151360
2009-08-24cp-tree.h (DECL_DEFERRED_FN): Remove.Jason Merrill1-20/+9
* cp-tree.h (DECL_DEFERRED_FN): Remove. (struct lang_decl_fn): Remove deferred flag. * class.c (build_clone): Don't set it. * decl2.c (note_vague_linkage_fn): Don't check or set it. (mark_used): Don't check it. * method.c (make_thunk, make_alias_for): Don't set it. From-SVN: r151063
2009-08-24* decl2.c (mark_used): Streamline logic.Jason Merrill1-20/+15
From-SVN: r151062
2009-08-24re PR c++/41109 (Argument flagged as unused despite use in sizeof())Jason Merrill1-16/+16
PR c++/41109 PR c++/41110 PR c++/41134 * cp-tree.h (DECL_ODR_USED): New macro. (struct lang_decl_base): Add odr_used flag. * decl.c (duplicate_decls): Propagate it. Use it for error. * pt.c (register_specialization): Use it for error. * decl2.c (mark_used): Use it as gating flag rather than TREE_USED. (cp_write_global_declarations): Use it for error. (tree_used_ok): Remove. * cp-tree.h: Remove tree_used_ok. * call.c (build_call_a): Don't call it. * init.c (build_offset_ref): Likewise. From-SVN: r151061
2009-08-19tweak commentJason Merrill1-3/+4
From-SVN: r150940
2009-08-19re PR c++/41119 (Revision 150805 failed 447.dealII in SPEC CPU 2006)Jason Merrill1-0/+9
PR c++/41119 PR c++/41120 * decl2.c (mark_used): Increment function_depth during synthesis. * parser.c (cp_parser_default_argument): Not here. From-SVN: r150939
2009-08-16Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL and ↵Jason Merrill1-15/+24
VAR_DECL... Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL and VAR_DECL, so mark_used only has effect the first time. * decl2.c (mark_used): Just return if TREE_USED is already set. Don't set TREE_USED if cp_unevaluated_operand is set. (tree_used_ok): New fn. * init.c (build_offset_ref): Check it instead of TREE_USED. * call.c (build_call_a): Likewise. * cp-tree.h: Declare it. (DECL_NO_LINKAGE_CHECKED): No longer needed. (struct lang_decl_base): Remove no_linkage_checked bitfield. From-SVN: r150807
2009-08-16* decl2.c (finish_static_data_member_decl): Don't set TREE_USED.Jason Merrill1-4/+1
From-SVN: r150806
2009-08-16* decl2.c (mark_used): It's ok to synthesize for default args now.Jason Merrill1-6/+1
From-SVN: r150805
2009-08-10Implement DR 757...Jason Merrill1-0/+70
Implement DR 757: It's OK for a decl to use a type without linkage so long as the decl is defined in the current translation unit. * decl2.c (no_linkage_decls): New vector. (mark_used): Add decls that use types with no linkage. (cp_write_global_declarations): Check that they are defined. (decl_defined_p, no_linkage_error): New fns. * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro. (struct lang_decl_base): Add flag. * decl.c (grokfndecl): Don't check type linkage. (grokvardecl): If the type has no linkage, just make sure DECL_LANG_SPECIFIC is set. * pt.c (check_instantiated_arg): Don't check type linkage. * name-lookup.c (is_local_extern): New fn. * name-lookup.h: Declare it. From-SVN: r150634
2009-07-17re PR c/40401 (ICE: verify_gimple failed)Richard Guenther1-2/+1
2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-14re PR debug/40705 (ICE in gen_type_die_with_usage, at dwarf2out.c:15117)Dodji Seketeli1-1/+3
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-04re PR c++/40619 ([c++0x] ICE on repeated decltype expression in auto functions)Jason Merrill1-23/+0
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 Merrill1-1/+0
* 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-06-18class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.Aldy Hernandez1-1/+1
* 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-16c-common.c (skip_evaluation): Don't define.Ian Lance Taylor1-1/+1
./: * 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-15cgraphunit.c (cgraph_function_versioning,save_inline_function_body): Use ↵Rafael Avila de Espindola1-4/+4
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 Hernandez1-4/+7
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 Merrill1-0/+1
PR c++/40381 * decl2.c (mark_used): Return after complaining about deleted fn. From-SVN: r148319
2009-05-25re PR c++/38064 ([c++0x] operator== doesn't work for enum classes)Jason Merrill1-1/+1
PR c++/38064 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in arithmetic comparisons. (cp_common_type): Handle scoped enums. * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P. (add_builtin_candidate, add_builtin_candidates): Likewise. (convert_like_real): Likewise. * class.c (check_bitfield_decl): Likewise. * decl.c (check_static_variable_definition): Likewise. (compute_array_index_type): Likewise. * decl2.c (grokbitfield): Likewise. * init.c (build_new_1): Likewise. * pt.c (convert_nontype_argument): Likewise. (current_instantiation): Likewise. * tree.c (pod_type_p): Likewise. * typeck.c (build_static_cast_1): Likewise. (build_reinterpret_cast_1): Likewise. From-SVN: r147854
2009-05-22tree.c (handle_dll_attribute): Mark dllexport'd inlines as non-external.Mark Mitchell1-0/+4
gcc/ * tree.c (handle_dll_attribute): Mark dllexport'd inlines as non-external. gcc/cp * decl2.c (decl_needed_p): Consider dllexport'd functions needed. * semantics.c (expand_or_defer_fn): Similarly. gcc/testsuite/ * gcc.dg/dll-6.c: New test. * gcc.dg/dll-6a.c: Likewise. * gcc.dg/dll-7.c: Likewise. * gcc.dg/dll-7a.c: Likewise. * g++.dg/ext/dllexport2.C: Likewise. * g++.dg/ext/dllexport2a.cc: Likewise. From-SVN: r147799