aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2008-04-04function.c (free_after_parsing): Replace with cxx_push_function_context from ↵Paolo Bonzini5-53/+22
C++ front-end. 2008-04-03 Paolo Bonzini <bonzini@gnu.org> * function.c (free_after_parsing): Replace with cxx_push_function_context from C++ front-end. (allocate_struct_function): Don't call langhook. * langhooks.h (struct lang_hooks_for_functions): Delete. (struct lang_hooks): Add back missing_noreturn_ok_p here, delete member "function". * langhooks-def.h (LANG_HOOKS_MISSING_NORETURN_OK_P): Add. (LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL, LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P, LANG_HOOKS_FUNCTION_INITIALIZER): Delete. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_MISSING_NORETURN_OK_P, remove LANG_HOOKS_FUNCTION_INITIALIZER. * tree-cfg.c: Adjust call to missing_noreturn_ok_p langhook. * c-objc-common.h (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to LANG_HOOKS_MISSING_NORETURN_OK_P. cp: 2008-04-03 Paolo Bonzini <bonzini@gnu.org> * decl.c (cxx_push_function_context): Delete. (cxx_pop_function_context): Delete. (start_preparsed_function): Merge cxx_push_function_context (!f->decl code only). * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL): Delete. (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to LANG_HOOKS_MISSING_NORETURN_OK_P. * cp-tree.h (cxx_push_function_context, cxx_pop_function_context): Delete prototype. * semantics.c (current_stmt_tree): Fix comment. From-SVN: r133900
2008-04-03re PR c++/35741 (ICE with offsetof and references)Jakub Jelinek2-0/+8
PR c++/35741 * semantics.c (finish_offsetof): Undo effect of convert_from_reference before calling fold_offsetof. * g++.dg/other/offsetof5.C: New test. From-SVN: r133863
2008-04-03t-uclinux (generated_files): Add sysroot-suffix.h.Tom Tromey2-0/+6
gcc/ 2008-04-03 Tom Tromey <tromey@redhat.com> Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * config/m68k/t-uclinux (generated_files): Add sysroot-suffix.h. * config/bfin/t-bfin-linux (generated_files): Add linux-sysroot-suffix.h. * doc/install.texi (Prerequisites): Require make 3.80. * doc/sourcebuild.texi (Front End Directory): Document new variable. * Makefile.in (generated_files): New variable. (ALL_HOST_OBJS): New variable. ($(ALL_HOST_OBJS)): New target. gcc/java/ 2008-04-03 Tom Tromey <tromey@redhat.com> * Make-lang.in (java_OBJS): New variable. gcc/objc/ 2008-04-03 Tom Tromey <tromey@redhat.com> * Make-lang.in (objc_OBJS): New variable. gcc/objcp/ 2008-04-03 Tom Tromey <tromey@redhat.com> * Make-lang.in (obj-c++_OBJS): New variable. gcc/cp/ 2008-04-03 Tom Tromey <tromey@redhat.com> * Make-lang.in (c++_OBJS): New variable. gcc/fortran/ 2008-04-03 Tom Tromey <tromey@redhat.com> * Make-lang.in (fortran_OBJS): New variable. Co-Authored-By: Ralf Wildenhues <Ralf.Wildenhues@gmx.de> From-SVN: r133862
2008-04-03tree-inline.c (copy_generic_body, [...]): Export.Paolo Bonzini2-0/+35
2007-03-09 Paolo Bonzini <bonzini@gnu.org> * tree-inline.c (copy_generic_body, copy_decl_no_change): Export. (remap_block): Call id->transform_lang_insert_block instead of langhook. (optimize_inline_calls, unsave_expr_now, tree_function_versioning): Set id.transform_lang_insert_block to NULL. (clone_body): Move to cp/optimize.c * tree-inline.h (struct copy_body_data): Change transform_lang_insert_block to function pointer. (copy_generic_body, copy_decl_no_change): Export. * langhooks.h (struct lang_hooks_for_decls): Kill insert_block. * langhooks-def.h (LANG_HOOKS_INSERT_BLOCK): Kill. (LANG_HOOKS_DECLS): Remove LANG_HOOKS_INSERT_BLOCK. * c-tree.h (insert_block): Kill. * c-decl.c (insert_block): Kill. cp: 2007-03-09 Paolo Bonzini <bonzini@gnu.org> * optimize.c (clone_body): New, from tree-inline.c. ada: 2007-03-09 Paolo Bonzini <bonzini@gnu.org> * gigi.h (insert_block): Kill. * utils.c (insert_block): Kill. java: 2007-03-09 Paolo Bonzini <bonzini@gnu.org> * java-tree.h (insert_block): Kill. * decl.c (insert_block): Kill. fortran: 2007-03-09 Paolo Bonzini <bonzini@gnu.org> * f95-lang.c (insert_block): Kill. From-SVN: r133861
2008-04-03c-objc-common.h (LANG_HOOKS_FUNCTION_ENTER_NESTED, [...]): Delete.Paolo Bonzini4-7/+12
2008-04-03 Paolo Bonzini <bonzini@gnu.org> * c-objc-common.h (LANG_HOOKS_FUNCTION_ENTER_NESTED, LANG_HOOKS_FUNCTION_LEAVE_NESTED): Delete. * c-tree.h (c_push_function_context, c_pop_function_context): Remove argument. * c-decl.c (c_push_function_context, c_pop_function_context): Remove argument, call {push,pop}_function_context from here. * c-parser.c: Use c_{push,pop}_function_context. * function.c (push_function_context_to): Move meat ... (push_function_context): ... here. Simplify. * function.c (pop_function_context_from): Move meat ... (pop_function_context): ... here. Simplify. * langhooks.h (struct lang_hooks_for_functions): Remove enter_nested, leave_nested). * langhooks-def.h (LANG_HOOKS_FUNCTION_ENTER_NESTED, LANG_HOOKS_FUNCTION_LEAVE_NESTED): Delete. (LANG_HOOKS_FUNCTION_INITIALIZER): Delete them from here. * tree.h (push_function_context_to, pop_function_context_from): Remove. cp: 2008-04-03 Paolo Bonzini <bonzini@gnu.org> * method.c (synthesize_method): Use {push,pop}_function_context. * name-lookup.c (push_to_top_level): Likewise. * parser.c (cp_parser_late_parsing_for_member): Likewise. From-SVN: r133860
2008-03-30re PR c++/35578 (Error about misplaced 'friend' word is issued on a wrong line)Volker Reichelt2-1/+7
PR c++/35578 * parser.c (cp_parser_decl_specifier_seq): Add location to error message. * g++.dg/parse/friend8.C: New test. From-SVN: r133738
2008-03-27sourcebuild.texi, [...]: Revert automatic dependency patch.Tom Tromey2-5/+91
gcc/ * doc/sourcebuild.texi, doc/install.texi, configure, aclocal.m4, configure.ac, Makefile.in, config/t-darwin, config/m32c/t-m32c, config/spu/t-spu-elf, config/i386/t-interix, config/i386/t-cygming, config/i386/x-i386, config/i386/t-cygwin, config/i386/x-darwin, config/i386/x-mingw32, config/i386/t-netware, config/i386/x-cygwin, config/i386/t-nwld, config/sh/t-sh, config/sh/t-symbian, config/x-linux, config/t-sol2, config/x-hpux, config/x-darwin, config/ia64/t-ia64, config/x-solaris, config/t-vxworks, config/m68k/t-uclinux, config/rs6000/x-rs6000, config/rs6000/x-darwin64, config/rs6000/x-darwin, config/rs6000/t-rs6000, config/score/t-score-elf, config/arm/t-strongarm-pe, config/arm/t-pe, config/arm/t-arm, config/arm/t-wince-pe, config/v850/t-v850, config/v850/t-v850e, config/bfin/t-bfin-linux: Revert automatic dependency patch. gcc/java/ * Make-lang.in: Revert automatic dependency patch. gcc/objc/ * Make-lang.in: Revert automatic dependency patch. gcc/objcp/ * Make-lang.in: Revert automatic dependency patch. gcc/cp/ * Make-lang.in: Revert automatic dependency patch. gcc/fortran/ * Make-lang.in: Revert automatic dependency patch. From-SVN: r133652
2008-03-27re PR bootstrap/35704 (Bootstrap failure on i686-apple-darwin9 at revision ↵Douglas Gregor7-16/+50
133519 (take 2).) 2008-03-27 Douglas Gregor <doug.gregor@gmail.com> PR obj-c++/35704 * typeck.c (build_x_compound_expr): Use cp_build_compound_expr. (build_compound_expr): New, for compatibility with C build_compound_expr. (cp_build_compound_expr): Renamed from build_compound_expr. (build_c_cast): New, for compatibility with C build_c_cast. (cp_build_c_cast): Renamed from build_c_cast. * init.c (build_vec_delete_1): Fix calls to build_compound_expr. * decl.c (cxx_maybe_build_cleanup): Ditto. * cp-tree.h (build_compound_expr): Add C-compatibile prototype. (cp_build_compound_expr): Renamed from build_compound_expr. (build_c_cast): Add C-compatible prototype. (cp_build_c_cast): Renamed from build_c_cast. * typeck2.c (build_functional_cast): Use cp_build_c_cast. * parser.c (cp_parser_cast_expression): Fix call to build_c_cast. 2008-03-27 Douglas Gregor <doug.gregor@gmail.com> PR obj-c++/35704 * objc-act.c (objc_build_component_ref): Fix call to finish_class_member_access_expr. (objc_generate_cxx_ctor_or_dtor): Fix call to build_special_member_call. From-SVN: r133643
2008-03-27pt.c (tsubst_copy): Cope with tsubst_pack_expansion returning a pack ↵Douglas Gregor3-28/+66
expansion... 2008-03-27 Douglas Gregor <doug.gregor@gmail.com> * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with tsubst_pack_expansion returning a pack expansion, or a TREE_VEC ending in a pack expansion, both of which can occur when substituting into a nested template. (tsubst_copy_and_build) <case SIZEOF_EXPR>: When we're instantiating the sizeof...(X) form, make tsubst_copy do the work. * parser.c (cp_parser_template_parameter): Deal with unnamed non-type template parameter packs identified by pack expansions in the parameter type. 2008-03-27 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/variadic91.C: New. From-SVN: r133642
2008-03-26re PR c++/35546 (__attribute__(format...) broken for members of template ↵Jakub Jelinek2-3/+27
classes?) PR c++/35546 * pt.c (apply_late_template_attributes): Don't call tsubst on first attribute argument if it is IDENTIFIER_NODE. * g++.dg/ext/attrib33.C: New test. From-SVN: r133615
2008-03-26re PR c++/35332 (Broken diagnostics for builtins)Jakub Jelinek2-0/+14
PR c++/35332 * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR and LTGT_EXPR to pp_expression. * g++.dg/other/error27.C: New test. From-SVN: r133600
2008-03-26pt.c (coerce_template_template_parm): Moved the body of the loop of ↵Douglas Gregor2-53/+143
coerce_template_template_parms here... 2008-03-26 Douglas Gregor <doug.gregor@gmail.com> * pt.c (coerce_template_template_parm): Moved the body of the loop of coerce_template_template_parms here, to make iteration over a template argument pack simpler. Also, allow matching of a template parameter pack in the template template parameter to a template parameter in the template template argument. (coerce_template_template_parms): Deal with variadic template template parameters. Use coerce_template_template_parm. (unify): Make sure we coerce the template template argument's template arguments to the template template parameter's template parameters, not the other way around. 2008-03-26 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/variadic84.C: Update to reflect the change in variadic template template parameter binding semantics. * g++.dg/cpp0x/variadic85.C: Ditto. * g++.dg/cpp0x/variadic88.C: New. * g++.dg/cpp0x/variadic89.C: New. * g++.dg/cpp0x/variadic90.C: New. * g++.dg/cpp0x/variadic-ex14.C: Update to reflect the change in variadic template template parameter binding semantics. * g++.dg/cpp0x/variadic-lambda.C: New. From-SVN: r133543
2008-03-25x-solaris (host-solaris.o): Update.Tom Tromey2-87/+13
gcc * config/x-solaris (host-solaris.o): Update. * config/x-linux (host-linux.o): Update. * config/x-hpux (host-hpux.o): Update. * config/x-darwin (host-darwin.o): Update. * config/v850/t-v850e (v850-c.o): Update. * config/v850/t-v850 (v850-c.o): Update. * config/t-vxworks (vxworks.o): Update. * config/t-sol2 (sol2-c.o, sol2.o): Update. * config/t-darwin (darwin.o, darwin-c.o, darwin-driver.o): Update. * config/spu/t-spu-elf (spu-c.o): Update. (spu.o): Remove. * config/sh/t-symbian (sh-c.o): Update. (symbian.o): Update. * config/sh/t-sh (sh-c.o): Update. * config/score/t-score-elf (score7.o, score3.o): Update. * config/rs6000/x-rs6000 (driver-rs6000.o): Update. * config/rs6000/x-darwin64 (host-ppc64-darwin.o): Update. * config/rs6000/x-darwin (host-ppc-darwin.o): Update. * config/rs6000/t-rs6000 (rs6000-c.o): Update. (rs6000.o): Remove. * config/m68k/t-uclinux (generated_files): Add sysroot-suffix.h. * config/m32c/t-m32c (m32c-pragma.o): Update. * config/ia64/t-ia64 (ia64-c.o): Update. * config/i386/x-mingw32 (host-mingw32.o): Update. * config/i386/x-i386 (driver-i386.o): Update. * config/i386/x-darwin (host-i386-darwin.o): Update. * config/i386/x-cygwin (host-cygwin.o): Update. * config/i386/t-nwld (nwld.o): Update. * config/i386/t-netware (netware.o): Update. * config/i386/t-interix (winnt.o): Update. * config/i386/t-cygwin (cygwin1.o, cygwin2.o): Update. * config/i386/t-cygming (winnt.o, winnt-cxx.o, winnt-stubs.o, msformat-c.o): Update. * config/bfin/t-bfin-linux (generated_files): Add linux-sysroot-suffix.h. * config/arm/t-wince-pe (pe.o): Update. * config/arm/t-strongarm-pe (pe.o): Update. * config/arm/t-pe (pe.o): Update. * config/arm/t-arm (arm-c.o): Update. * doc/install.texi (Prerequisites): Require make 3.80. * Makefile.in: Remove .o targets. (CCDEPMODE, DEPDIR, depcomp, BUILD_DEPMODE): New variables. (OBSTACK_H, FIBHEAP_H, PARTITION_H, MD5_H, BCONFIG_H): Remove. (simple_generated_h, simple_generated_c): Move earlier. (generated_files): New variable. (TARGET_H, MACHMODE_H, HOOKS_H, HOSTHOOKS_DEF_H, LANGHOOKS_DEF_H, TARGET_DEF_H, RTL_BASE_H, RTL_H, PARAMS_H, BUILTINS_DEF, TREE_H, BASIC_BLOCK_H, GCOV_IO_H, COVERAGE_H, DEMANGLE_H, RECOG_H, ALIAS_H, EMIT_RTL_H, FLAGS_H, FUNCTION_H, EXPR_H, OPTABS_H, REGS_H, RA_H, RESOURCE_H, SCHED_INT_H, INTEGRATE_H, CFGLAYOUT_H, CFGLOOP_H, IPA_UTILS_H, IPA_REFERENCE_H, IPA_TYPE_ESCAPE_H, CGRAPH_H, DF_H, RESOURCE_H, DDG_H, GCC_H, GGC_H, TIMEVAR_H, INSN_ATTR_H, C_COMMON_H, C_PRAGMA_H, C_TREE_H, SYSTEM_H, PREDICT_H, DECNUM_H, MKDEPS_H, SYMTAB_H, TREE_DUMP_H, TREE_GIMPLE_H, TREE_FLOW_H, TREE_SSA_LIVE_H, PRETTY_PRINT_H, DIAGNOSTIC_H, C_PRETTY_PRINT_H, SCEV_H, LAMBDA_H, TREE_DATA_REF_H, VARRAY_H, TREE_INLINE_H, REAL_H, DBGCNT_H, EBIMAP_H): Remove. (.c.o): Remove. (COMPILE.base, COMPILE): New variables. (%.o): New pattern rule. (ALL_HOST_OBJS): New variable. (xgcc$(exeext), cpp$(exeext)): Remove extra version.o. (dummy-checksum.o, cc1-checksum.o): Remove. (DRIVER_SHLIB): New variable. (DRIVER_DEFINES): Use it. (gencondmd.c): Move out of build/. (s-conditions): Update. (BUILDCOMPILE.base, BUILDCOMPILE): New variables. (ALL_BUILD_OBJS): Likewise. (build/%.o): Use BUILDCOMPILE. (build/ggc-none.o, build/ggc-none.o, build/min-insn-modes.o, build/print-rtl.o, build/read-rtl.o, build/rtl.o, build/vec.o, build/gencondmd.o, build/genattrtab.o, build/genautomata.o, build/gencheck.o, build/gencodes.o, build/genconditions.o, build/genconfig.o, build/genconstants.o, build/genemit.o, build/genextract.o, build/genflags.o, build/genmddeps.o, build/genopinit.o, build/genoutput.o, build/genpeep.o, build/genpreds.o, build/genrecog.o, build/gcov-iov.o, build/gen-protos.o, build/scan.o, build/fix-header.o, build/scan-decls.o): Simplify. (collect2.o, c-opts.o, gcc.o, gccspec.o, gcc-options.o, cppdefault.o, protoize.o, unprotoize.o, intl.o, version.o, prefix.o, toplev.o): Reduce to variable setting. (libbackend.o): Use COMPILE. Remove most dependencies. Move later. ($(out_object_file), gcc-options.o): New targets. ($(ALL_HOST_OBJS)): New target. Include dependency files. * configure: Rebuilt. * configure.ac: Call ZW_CREATE_DEPDIR, ZW_PROG_COMPILER_DEPENDENCIES. * doc/sourcebuild.texi (Front End Directory): Document new variable. gcc/java * Make-lang.in: Removed most explicit .o targets. (java/jvspec.o): Reduce to variable setting. Moved to java/. ($(GCJ)$(exeext)): Update. (JAVA_OBJS): New variable. (JCFDUMP_OBJS): Reformat. (java_OBJS): New variable. (java/jvspec.o-warn): Update. (java/parse.o-warn): Remove. (JAVA_TREE_H): Remove. (java/jcf-io.o): Reduce to variable setting. (ALL_CPPFLAGS): Likewise. gcc/objc * Make-lang.in (objc_OBJS): New variable. (cc1obj-checksum.o, objc/objc-lang.o, objc/objc-act.o): Remove. gcc/objcp * Make-lang.in (objcp_OBJS): New variable. (cc1objplus-checksum.o, objcp/objcp-lang.o, objcp/objcp-decl.o, objcp/objcp-act.o): Remove. gcc/cp * Make-lang.in: Remove .o targets. (cp/g++spec.o): Moved to cp/. Reduce to variable setting. (GXX_OBJS): Update. (c++_OBJS): New variable. (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove. gcc/fortran * Make-lang.in: Remove .o targets. (fortran_OBJS): New variable. (fortran/gfortranspec.o): Move to fortran/. Reduce to variable setting. (GFORTRAN_D_OBJS): Update. (GFORTRAN_TRANS_DEPS): Remove. From-SVN: r133523
2008-03-25typeck.c (composite_pointer_type_r): Add SFINAE support.Douglas Gregor17-809/+1596
2008-03-25 Douglas Gregor <doug.gregor@gmail.com> * typeck.c (composite_pointer_type_r): Add SFINAE support. (composite_pointer_type): Ditto. (common_type): Fix call to composite_pointer_type. (cxx_sizeof_nowarn): New; used to be a macro. (cxx_sizeof_expr): Add SFINAE support. (cxx_alignof_expr): Ditto. (decay_conversion): Fix calls for SFINAE support. (rationalize_conditional_expr): Add SFINAE support. (build_class_member_access_expr): Ditto. (finish_class_member_access_expr): Ditto. (build_x_indirect_ref): Ditto. (build_indirect_ref): Original version renamed to cp_build_indirect_ref; new version provides a bridge from c-common. (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE support. (get_member_function_from_ptrfunc): Fix calls for SFINAE support. (build_function_call): Original version renamed to cp_build_function_call; new version provides a bridge from c-common. (cp_build_function_call): Was build_function_call; added SFINAE support. (convert_arguments): Add SFINAE support. (build_x_binary_op): Ditto. (build_binary_op): Original version renamed to cp_build_binary_op; new version provides a bridge from c-common. (cp_build_binary_op): Was build_binary_op; added SFINAE support. (pointer_diff): Fix calls for SFINAE. (build_x_unary_op): Add SFINAE support. (condition_conversion): Fix calls for SFINAE. (build_unary_op): Original version renamed to cp_build_unary_op; new version provides a bridge from c-common. (cp_build_unary_op): Was build_unary_op; added SFINAE support. (unary_complex_lvalue): Fix calls for SFINAE. (build_x_conditional_expr): Add SFINAE support. (build_x_compound_expr_from_list): Fix calls for SFINAE. (build_x_compound_expr): Add SFINAE support. (convert_ptrmem): Fix calls for SFINAE. (build_static_cast_1): Add SFINAE support. (build_static_cast): Ditto. (build_reinterpret_cast_1): Ditto. (build_reinterpret_cast): Ditto. (build_const_cast_1): Ditto. (build_const_cast): Ditto. (build_c_cast): Ditto. (build_modify_expr): Original version renamed to cp_build_modify_expr; new version provides a bridge from c-common. (cp_build_modify_expr): Was build_modify_expr; added SFINAE support. (build_x_modify_expr): Add SFINAE support. (build_ptrmemfunc): Fix calls for SFINAE. (convert_for_assignment): Add SFINAE support. (convert_for_initialization): Ditto. (check_return_expr): Fix calls for SFINAE. (lvalue_or_else): Add SFINAE support. * init.c (perform_member_init): Fix calls for SFINAE. (emit_mem_initializers): Ditto. (expand_virtual_init): Ditto. (expand_cleanup_for_base): Ditto. (build_aggr_init): Add SFINAE support. (expand_default_init): Ditto. (expand_aggr_init_1): Fix calls for SFINAE. (build_offset_ref): Ditto. (build_new_1): Add SFINAE support. (build_new): Ditto. (build_vec_delete_1): Fix calls for SFINAE. (get_temp_regvar): Ditto. (build_vec_init): Add SFINAE support. (build_dtor_call): Fix calls for SFINAE. (build_delete): Ditto. (push_base_cleanups): Ditto. (build_vec_delete_1): Ditto. * class.c (build_base_path): Fix calls for SFINAE. (build_simple_base_path): Ditto. (convert_to_base_statically): Ditto. (build_vfn_ref): Ditto. (resolve_address_of_overloaded_function): Ditto. * decl.c (check_initializer): Fix calls for SFINAE. (register_dtor_fn): Ditto. (compute_array_index_type): Ditto. (finish_enum): Ditto. (start_preparsed_function): Ditto. (cxx_maybe_build_cleanup): Ditto. * call.c (convert_like): Add COMPLAIN argument. (convert_like_with_context): Ditto. (build_this): Fix calls for SFINAE. (build_user_type_conversion): Ditto. (resolve_args): Ditto. (build_new_function_call): Add SFINAE support. (build_operator_new_call): Fix calls for SFINAE. (build_object_call): Add SFINAE support. (build_conditional_expr): Ditto. (build_new_op): Ditto. (build_op_delete_call): Fix calls for SFINAE. (build_temp): Ditto. (convert_like_real): Add SFINAE support. (build_x_va_arg): Fix calls for SFINAE. (convert_default_arg): Ditto. (build_over_call): Add SFINAE support. (build_java_interface_fn_ref): Fix calls for SFINAE. (build_special_member_call): Add SFINAE support. (build_new_method_call): Ditto. (perform_implicit_conversion): Ditto. (perform_direct_initialization_if_possible): Ditto. (initialize_reference): Fix calls for SFINAE. * method.c (do_build_assign_ref): Fix calls for SFINAE. * rtti.c (build_headof): Fix calls for SFINAE. (get_tinfo_decl_dynamic): Ditto. (get_typeid): Ditto. (build_dynamic_cast_1): Add SFINAE support. (build_dynamic_cast): Ditto. (tinfo_base_init): Fix calls for SFINAE. * except.c (do_get_exception_ptr): Fix calls for SFINAE. (do_end_catch): Ditto. (initialize_handler_parm): Ditto. (expand_start_catch_block): Ditto. (do_allocate_exception): Ditto. (do_free_exception): Ditto. (build_throw): Ditto. * cvt.c (build_up_reference): Fix calls for SFINAE. (convert_to_reference): Ditto. (ocp_convert): Ditto. (convert_to_void): Add SFINAE support. * tree.c (build_dummy_object): Fix calls for SFINAE. (stabilize_expr): Ditto. * cp-tree.h (build_conditional_expr): Add tsubst_flags_t parameter. (build_new_method_call): Ditto. (build_special_member_call): Ditto. (build_new_op): Ditto. (perform_implicit_conversion): Ditto. (perform_direct_initialization_if_possible): Ditto. (convert_to_void): Ditto. (build_aggr_init): Ditto. (build_new): Ditto. (build_vec_init): Ditto. (build_dynamic_cast): Ditto. (finish_call_expr): Ditto (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter. (cxx_sizeof_nowarn): Remove macro; add function declaration. (build_class_member_access_expr): Add tsubst_flags_t parameter. (finish_class_member_access_expr): Ditto. (build_x_indirect_ref): Ditto. (cp_build_indirect_ref): New. (cp_build_function_call): Add tsubst_flags_t parameter. (build_x_unary_op): Ditto. (cp_build_unary_op): New. (build_x_conditional_expr): Add tsubst_flags_t parameter. (build_x_compound_expr): Ditto. (build_compound_expr): Ditto. (build_static_cast): Ditto. (build_reinterpret_cast): Ditto. (build_const_cast): Ditto. (build_c_cast): Ditto. (build_x_modify_expr): Ditto. (cp_build_modify_expr): New. (convert_for_initialization): Add tsubst_flags_t parameter. (cp_build_binary_op): Remove macro; add function declaration. (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter. (lvalue_or_else): Ditto. (build_functional_cast): Ditto. * typeck2.c (digest_init): Fix calls for SFINAE. (process_init_constructor_array): Ditto. (process_init_constructor_record): Ditto. (build_x_arrow): Ditto. (build_m_component_ref): Ditto. (build_functional_cast): Add SFINAE support. * pt.c (tsubst_copy_and_build): Add (more) SFINAE support. * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_asm_stmt): Ditto. (finish_non_static_data_member): Ditto. (finish_qualified_id_expr): Ditto. (finish_call_expr): Add SFINAE support. (finish_increment_expr): Fix calls for SFINAE. (finish_unary_op_expr): Ditto. (simplify_aggr_init_expr): Ditto. (finish_omp_clauses): Ditto. (finish_omp_for): Ditto. (finish_omp_barrier): Ditto. (finish_omo_flush): Ditto. * decl2.c (grok_array_decl): Fix calls or SFINAE. (build_anon_union_vars): Ditto. (get_guard_cond): Ditto. (set_guard): Ditto. (one_static_initialization_or_destruction): Ditto. (do_static_initialization_or_destruction): Ditto. (generate_ctor_or_dtor_function): Ditto. (build_offset_ref_call_from_tree): Ditto. * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE. (cp_parser_postfix_dot_deref_expression): Ditto. (cp_parser_unary_expression): Ditto. (cp_parser_new_expression): Ditto. (cp_parser_cast_expression): Ditto. (cp_parser_binary_expression): Ditto. (cp_parser_question_colon_clause): Ditto. (cp_parser_assignment_expression): Ditto. (cp_parser_expression): Ditto. (cp_parser_builtin_offsetof): Ditto. (cp_parser_template_argument): Ditto. (cp_parser_functional_cast): Ditto. 2008-03-25 Douglas Gregor <doug.gregor@gmail.com> * c-common.c (c_sizeof_or_alignof_type): If we're not allowed to complain when we hit an error, return ERROR_MARK_NODE. 2008-03-25 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/template/sfinae4.C: New. * g++.dg/template/sfinae5.C: New. * g++.dg/template/sfinae6.C: New. * g++.dg/template/sfinae6_neg.C: New. * g++.dg/template/sfinae7.C: New. * g++.dg/template/sfinae8.C: New. * g++.dg/template/sfinae9.C: New. * g++.dg/template/sfinae10.C: New. * g++.dg/template/sfinae11.C: New. * g++.dg/template/sfinae12.C: New. * g++.dg/template/sfinae13.C: New. * g++.dg/template/sfinae14C: New. From-SVN: r133519
2008-03-24lex.c (handle_pragma_interface): Don't copy the filename.Tom Tromey2-3/+8
* lex.c (handle_pragma_interface): Don't copy the filename. (handle_pragma_implementation): Copy filename using xstrdup. From-SVN: r133487
2008-03-21cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.Paolo Carlini21-163/+215
2008-03-21 Paolo Carlini <pcarlini@suse.de> * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P. (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P. (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P. (PROMOTES_TO_AGGR_TYPE): Remove. (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust. * typeck.c (unary_complex_lvalue, build_modify_expr, convert_for_initialization): Adjust. * init.c (is_aggr_type): Remove. (is_class_type): Add. (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init, build_delete): Adjust. * lex.c (make_aggr_type): Remove. (make_class_type): Add. (cxx_make_type): Adjust. * class.c (finish_struct_1, fixed_type_or_null, is_empty_class): Adjust. * decl.c (build_typename_type, make_typename_type, make_unbound_class_template, cxx_init_decl_processing, check_tag_decl, groktypename, start_decl_1, layout_var_decl, check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms, grok_op_properties, xref_tag, check_function_type): Adjust. * call.c (check_dtor_name, standard_conversion, implicit_conversion, add_builtin_candidate, add_builtin_candidates, build_user_type_conversion_1, convert_like_real, build_cxx_call, is_subseq, compare_ics): Adjust. * method.c (use_thunk): Adjust. * rtti.c (build_dynamic_cast_1, create_pseudo_type_info, create_tinfo_types): Adjust. * cvt.c (cp_convert_to_pointer, convert_to_pointer_force, build_up_reference, convert_to_reference, convert_from_reference, ocp_convert, build_expr_type_conversion): Adjust. * tree.c (bind_template_template_parm, error_type): Adjust. * dump.c (cp_dump_tree): Adjust. * search.c (lookup_member): Adjust. * friend.c (make_friend_class, do_friend): Adjust. * typeck2.c (store_init_value, process_init_constructor_array, process_init_constructor_record, build_x_arrow, build_m_component_ref, build_functional_cast): Adjust. * pt.c (finish_member_template_decl, process_template_parm, lookup_template_class, tsubst_function_type, tsubst, tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc): Adjust. * semantics.c (begin_class_definition, finish_base_specifier, finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type): Adjust. * name-lookup.c (constructor_name_p, push_overloaded_decl, do_class_using_decl, lookup_qualified_name, maybe_process_template_type_declaration): Adjust. * decl2.c (grok_array_decl, check_member_template, constrain_class_visibility): Adjust. * parser.c (cp_parser_class_name): Adjust. From-SVN: r133434
2008-03-18expr.c (store_expr): Assume lang_hooks.reduce_bit_field_operations is true.Paolo Bonzini2-2/+4
2008-03-18 Paolo Bonzini <bonzini@gnu.org> * expr.c (store_expr): Assume lang_hooks.reduce_bit_field_operations is true. (expand_expr_real_1) <REDUCE_BIT_FIELD>: Don't look at ignore. (expand_expr_real_1): Assume lang_hooks.reduce_bit_field_operations is true. Add "&& !ignore" condition to reduce_bit_field. Modify target after ignore has been set, and move there also the commputation of subtarget and original_target. * langhooks-def.h (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete. (LANG_HOOKS_INITIALIZER): Remove it. * langhooks.h (struct lang_hooks): Remove reduce_bit_field_operations. ada: 2008-03-18 Paolo Bonzini <bonzini@gnu.org> * misc.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete. cp: 2008-03-18 Paolo Bonzini <bonzini@gnu.org> * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete. From-SVN: r133316
2008-03-17re PR c++/35548 (g++ 4.3 miscompile this simple program)Jason Merrill2-1/+8
PR c++/35548 * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding a temp directly to a reference as per DR391. From-SVN: r133299
2008-03-12revert: [multiple changes]Richard Guenther3-14/+22
2008-03-12 Richard Guenther <rguenther@suse.de> PR c++/35469 Revert: 2008-02-04 Richard Guenther <rguenther@suse.de> PR java/35035 * decl.c (record_builtin_java_type): Make jboolean a integer type again where its mode doesn't match that of bool. 2008-01-25 Richard Guenther <rguenther@suse.de> PR c++/33887 * decl.c (record_builtin_java_type): Make __java_boolean a variant of bool. * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check after TYPE_MAIN_VARIANT check. From-SVN: r133142
2008-03-10re PR c++/35328 (ICE with firstprivate variable with invalid destructor)Jakub Jelinek2-2/+6
PR c++/35328 * semantics.c (finish_omp_clauses): Look through NOP_EXPR even if errorcount. * g++.dg/gomp/pr35328.C: New test. From-SVN: r133087
2008-03-10re PR c++/35337 (Broken diagnostic for firstprivate clause)Jakub Jelinek2-4/+16
PR c++/35337 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for DECL_P in not a variable and appears more than once error messages. * g++.dg/gomp/pr35337.C: New test. From-SVN: r133086
2008-03-07revert: re PR c++/35049 (g++.dg/conversion/simd3.C:12: error: invalid ↵Paolo Bonzini6-36/+47
operands to binary + (have 'float __vector__' and 'int __vector__')) cp: 2008-03-07 Paolo Bonzini <bonzini@gnu.org> Revert: 2008-02-06 Douglas Gregor <doug.gregor@gmail.com> PR c++/35049 PR c++/35096 * typeck.c (structural_comptypes): Call cp_comptypes. (comptypes): New; called from the C/C++ common bits to perform strict checks. (cp_comptypes): Renamed from comptypes, which is already used, with a different signature, by the C++ front end. (build_reinterpret_cast_1): Call cp_comptypes. (ptr_reasonably_similar): Ditto. * decl.c (decls_match): Ditto. * cvt.c (convert_to_reference): Ditto. * cp-tree.h (same_type_p): Ditto. (same_or_base_type_p): Ditto. (comptypes): Rename to cp_comptypes. * pt.c (canonical_type_parameter): Call cp_comptypes. objcp: 2008-03-07 Paolo Bonzini <bonzini@gnu.org> Revert: 2008-02-07 Andreas Tobler <andreast-list@fgznet.ch> Douglas Gregor <doug.gregor@gmail.com> PR bootstrap/35115 * objcp-decl.c (objcp_comptypes): Call cp_comptypes, not comptypes. From-SVN: r133007
2008-03-07c-common.c (vector_types_convertible_p): Call langhook instead of comptypes.Paolo Bonzini2-13/+6
2008-03-07 Paolo Bonzini <bonzini@gnu.org> * c-common.c (vector_types_convertible_p): Call langhook instead of comptypes. cp: 2008-03-07 Paolo Bonzini <bonzini@gnu.org> * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete test for equivalence between pointer and references. From-SVN: r133002
2008-03-02re PR c++/24924 (front end and preprocessor pedantic_errors settings should ↵Manuel López-Ibáñez8-39/+52
agree) 2008-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 24924 * c-common.c (flag_permissive): Delete. (constant_expression_warnings): Check flags first. (constant_expression_error): New. * c-common.h (flag_permissive): Delete. (constant_expression_error): Declare. * flags.h (flag_permissive): Declare. Update description. * diagnostic.c (pedwarn): Update. (permerror): New. * diagnostic.h: (pedantic_error_kind): Rename as pedantic_warning_kind. (permissive_error_kind): New. * toplev.c (flag_permissive): Define. Update description. * toplev.h (permissive_error_kind): Declare. * c-errors.c (pedwarn_c99): Use pedantic_warning_kind. (pedwarn_c90): Use pedantic_warning_kind. * c-opts.c (c_common_post_options): flag_permissive does not affect flag_pedantic_errors. cp/ * class.c (finish_struct_anon): Use permerror instead of pedwarn. (check_field_decls): Likewise. (note_name_declared_in_class): Likewise. * call.c (build_new_op): Likewise. (convert_like_real): Likewise. (build_over_call): Likewise. * lex.c (unqualified_fn_lookup_error): Likewise. * parser.c (cp_parser_template_id): Likewise. * cvt.c (warn_ref_binding): Likewise. (convert_to_reference): Likewise. (ocp_convert): Likewise. (convert_to_void): Use error instead of pedwarn. * error.c (cp_cpp_error): Use pedantic_warning_kind. * decl.c (compute_array_index_type): Use constant_expression_error. testsuite/ * g++.dg/cpp/string-2.C: This is a warning now. * g++.dg/cpp/pedantic-errors.C: -pedantic-errors is not enabled by default, so add it. From-SVN: r132817
2008-03-01parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note that auto is ↵Douglas Gregor2-2/+53
either a storage class or a simple type specifier... 2008-03-01 Douglas Gregor <doug.gregor@gmail.com> * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note that auto is either a storage class or a simple type specifier, depending on the dialect. (cp_parser_decl_specifier_seq): Complain about `auto' as a storage specifier in C++98 mode, error in C++0x mode (since we don't support auto as a type specifier, yet). (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a storage specifier in C++0x mode. (cp_parser_simple_type_specifier): Parse `auto' as a simple-type-specifier, but error because we don't support it yet. 2008-03-01 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/auto1.C: New. From-SVN: r132806
2008-02-29parser.c (cp_parser_nonclass_name): New.Manuel López-Ibáñez2-35/+62
2008-02-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org> cp/ * parser.c (cp_parser_nonclass_name): New. (cp_parser_pseudo_destructor_name): Use it instead of cp_parser_type_name. (cp_parser_type_name): Move code to cp_parser_nonclass_name. From-SVN: r132778
2008-02-29toplev.c (input_file_stack, [...]): Remove.Tom Tromey3-8/+14
gcc * toplev.c (input_file_stack, input_file_stack_tick, fs_p, input_file_stack_history, input_file_stack_restored): Remove. (push_srcloc, pop_srcloc, restore_input_file_stack): Likewise. * input.h (struct file_stack): Remove. (push_srcloc, pop_srcloc, restore_input_file_stack): Likewise. (input_file_stack, input_file_stack_tick, INPUT_FILE_STACK_BITS): Likewise. * diagnostic.h (struct diagnostic_context) <last_module>: Change type. (diagnostic_last_module_changed): Add 'map' argument. (diagnostic_set_last_function): Likewise. * diagnostic.c (undiagnostic_report_current_module): Iterate using line map, not input_file_stack. * c-lex.c (fe_file_change): Don't use push_srcloc or pop_srcloc. gcc/cp * parser.c (struct cp_token) <input_file_stack_index>: Remove. (cp_lexer_get_preprocessor_token): Update. (cp_lexer_set_source_position_from_token): Don't call restore_input_file_stack. * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc. gcc/testsuite * g++.dg/warn/pragma-system_header2.C: Ignore "included from" line. From-SVN: r132775
2008-02-28revert: tree-flow.h (uid_decl_map_hash, [...]): Move ...Richard Guenther2-1/+8
2008-02-28 Richard Guenther <rguenther@suse.de> Revert: 2008-02-26 Richard Guenther <rguenther@suse.de> * tree-flow.h (uid_decl_map_hash, uid_decl_map_eq): Move ... * tree.h (uid_decl_map_hash, uid_decl_map_eq): ... here. (lookup_decl_from_uid): Declare. (remove_decl_from_map): Likewise. * tree-ssa.c (uid_decl_map_eq, uid_decl_map_hash): Move ... * tree.c (uid_decl_map_eq, uid_decl_map_hash): ... here. (decl_for_uid_map): New global hashtable mapping DECL_UID to the decl tree. (init_ttree): Allocate it. (insert_decl_to_uid_decl_map): New helper function. (make_node_stat): Insert new decls into the map. (copy_node_stat): Likewise. (lookup_decl_from_uid): New function. (remove_decl_from_map): Likewise. (print_decl_for_uid_map_statistics): New helper. (dump_tree_statistics): Call it. cp/ * decl.c (duplicate_decls): Remove decl from global mapping before ggc_freeing it. * tree-flow.h (struct gimple_df): Make referenced_vars a bitmap. (referenced_var_iterator): Adjust. (FOR_EACH_REFERENCED_VAR): Adjust. (FOR_EACH_REFERENCED_VAR_IN_BITMAP): New iterator. (num_referenced_vars): Adjust. * tree-flow-inline.h (gimple_referenced_vars): Adjust. (first_referenced_var): Remove. (end_referenced_vars_p): Likewise. (next_referenced_var): Likewise. (referenced_var_iterator_set): New helper function. * tree-dfa.c (referenced_var_lookup): Adjust. (referenced_var_check_and_insert): Likewise. (remove_referenced_var): Likewise. * tree-ssa.c (verify_flow_insensitive_alias_info): Use FOR_EACH_REFERENCED_VAR_IN_BITMAP. (verify_call_clobbering): Likewise. (verify_memory_partitions): Likewise. (init_tree_ssa): Allocate bitmap instead of hashtable for referenced_vars. (delete_tree_ssa): Adjust. * tree-ssa-alias.c (mark_aliases_call_clobbered): Use FOR_EACH_REFERENCED_VAR_IN_BITMAP. (compute_tag_properties): Likewise. (set_initial_properties): Likewise. (find_partition_for): Likewise. (update_reference_counts): Likewise. (dump_may_aliases_for): Likewise. * tree-ssa-operands.c (add_virtual_operand): Likewise. (add_call_clobber_ops): Likewise. (add_call_read_ops): Likewise. (get_asm_expr_operands): Likewise. * tree-into-ssa.c (dump_decl_set): Likewise. (update_ssa): Likewise. * tree-sra.c (scan_function): Likewise. (decide_instantiations): Likewise. (scalarize_parms): Likewise. * tree-ssa-alias-warnings.c (build_reference_table): Likewise. (dsa_named_for): Likewise. * tree-ssa-structalias.c (update_alias_info): Likewise. (merge_smts_into): Likewise. From-SVN: r132740
2008-02-27re PR c++/35368 (With #pragma visibility, `vtable for ↵Jakub Jelinek3-13/+35
__cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation) PR c++/35368 * rtti.c: Include c-pragma.h. (push_abi_namespace, pop_abi_namespace): New functions. (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index, create_tinfo_types, emit_support_tinfos): Use them. * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H). * g++.dg/ext/visibility/typeinfo2.C: New test. * g++.dg/ext/visibility/typeinfo3.C: New test. From-SVN: r132704
2008-02-26re PR c++/35315 (ICE with attribute transparent_union)Jason Merrill2-4/+19
PR c++/35315 * attribs.c (decl_attributes): Leave ATTR_FLAG_TYPE_IN_PLACE alone if it's the naming decl for the type's main variant. * cp/decl.c (grokdeclarator): Allow a typedef of an unnamed struct to name the struct for linkage purposes even if it has attributes. (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE. From-SVN: r132681
2008-02-26system.h (USE_MAPPED_LOCATION): Poison.Tom Tromey7-59/+23
gcc * system.h (USE_MAPPED_LOCATION): Poison. * Makefile.in (GTFILES): Put CPP_ID_DATA_H first. * tree-cfg.c (make_cond_expr_edges): Remove old location code. (make_goto_expr_edges): Likewise. (remove_bb): Likewise. (execute_warn_function_return): Likewise. * basic-block.h (struct edge_def) <goto_locus>: Change type to location_t. * c-common.c (fname_decl): Remove old location code. * tree-vect-transform.c (vect_finish_stmt_generation): Remove old location code. * rtl.h (ASM_OPERANDS_SOURCE_LOCATION): Remove old-location variant. (ASM_INPUT_SOURCE_LOCATION): Likewise. (gen_rtx_ASM_INPUT): Likewise. (gen_rtx_ASM_INPUT_loc): Likewise. (get_rtx_asm_OPERANDS): Remove. * cfglayout.c (insn_locators_alloc): Remove old location code. (set_curr_insn_source_location): Likewise. (curr_insn_locator): Likewise. * print-tree.c (print_node): Remove old location code. * tree-mudflap.c (mf_varname_tree): Remove old location code. (mf_file_function_line_tree): Remove test of USE_MAPPED_LOCATION. * cfgexpand.c (expand_gimple_cond_expr): Don't use location_from_locus. (construct_exit_block): Remove old location code. * emit-rtl.c (force_next_line_note): Remove old location code. * profile.c (branch_prob): Remove old location code. * tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE, LOC_LINE): Remove old-location variants. * langhooks.c (lhd_print_error_function): Remove old location code. * configure, config.in: Rebuilt. * configure.ac (--enable-mapped-location): Remove. * c-decl.c (c_init_decl_processing): Remove old location code. (finish_function): Likewise. * recog.c (decode_asm_operands): Remove old location code. * c-pch.c (c_common_read_pch): Remove old location code. * rtl.def (ASM_INPUT, ASM_OPERANDS): Remove old location variants. * gimple-low.c (lower_function_body): Remove old location code. * toplev.c (unknown_location): Remove. (push_srcloc): Remove old-location variant. (process_options): Remove old location code. (lang_dependent_init): Likewise. * input.h (UNKNOWN_LOCATION): Move definition. (location_t): Undeprecate. (source_locus): Remove. (location_from_locus): Remove. (struct location_s): Remove. Remove all old-location code. (input_line, input_filename): Remove. * final.c (final_scan_insn): Remove old location code. * diagnostic.c (diagnostic_build_prefix): Remove USE_MAPPED_LOCATION test. * tree.h (gimple_stmt) <locus>: Now a location_t. (tree_exp) <locus>: Likewise. (DECL_IS_BUILTIN): Remove old-location variant. (annotate_with_file_line, annotate_with_locus): Likewise. (expr_locus, set_expr_locus): Update. * tree.c (build1_stat): Remove old location code. (last_annotated_node): Remove. (annotate_with_file_line): Remove old-location variant. (annotate_with_locus): Likewise. (expr_location): Remove old location code. (set_expr_location): Likewise. (expr_has_location): Likewise. (expr_locus): Likewise. (set_expr_locus): Likewise. (expr_filename): Don't use location_from_locus. (expr_lineno): Likewise. * rtl-error.c (location_for_asm): Remove old location code. * c-lex.c (cb_line_change): Remove old location code. (fe_file_change): Likewise. (cb_def_pragma): Likewise. (c_lex_with_flags): Likewise. * gengtype.c (do_typedef): Don't special-case location types. (define_location_structures): Remove. (main): Don't call define_location_structures. * tree-pretty-print.c (dump_implicit_edges): Remove old location code. gcc/ada * misc.c (internal_error_function): Remove test of USE_MAPPED_LOCATION. * trans.c (gigi): Remove test of USE_MAPPED_LOCATION. (Sloc_to_locus): Remove old location code. gcc/cp * parser.c (eof_token): Remove old location code. (check_empty_body): Remove test of USE_MAPPED_LOCATION. * decl2.c (generate_ctor_or_dtor_function): Remove old location code. (cp_write_global_declarations): Likewise. * lex.c (cxx_init): Remove old location code. (handle_pragma_implementation): Remove test of USE_MAPPED_LOCATION. * pt.c (tsubst): Remove old location code. * error.c (cp_print_error_function): Remove test of USE_MAPPED_LOCATION. * decl.c (pop_label): Remove old location code. (finish_function): Likewise. gcc/fortran * trans-io.c (set_error_locus): Remove old location code. * trans-decl.c (gfc_set_decl_location): Remove old location code. * f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION. * scanner.c (gfc_gobble_whitespace): Remove old location code. (get_file): Likewise. (preprocessor_line): Likewise. (load_file): Likewise. (gfc_new_file): Likewise. * trans.c (gfc_trans_runtime_check): Remove old location code. (gfc_get_backend_locus): Likewise. (gfc_set_backend_locus): Likewise. * data.c (gfc_assign_data_value): Remove old location code. * error.c (show_locus): Remove old location code. * gfortran.h (gfc_linebuf): Remove old location code. (gfc_linebuf_linenum): Remove old-location variant. gcc/java * lang.c (java_post_options): Remove conditional. * expr.c (expand_byte_code): Remove old location code. * jcf-parse.c (set_source_filename): Remove old location code. (give_name_to_class): Likewise. (jcf_parse): Likewise. (duplicate_class_warning): Likewise. (parse_class_file): Likewise. (java_parse_file): Likewise. * decl.c (finish_method): Remove old location code. * class.c (push_class): Remove old location code. gcc/objc * objc-act.c (objc_init): Remove old location code. gcc/treelang * tree1.c (treelang_init): Remove old location code. (treelang_parse_file): Likewise. * lex.l (LINEMAP_POSITION_FOR_COLUMN): Remove. (update_lineno_charno): Remove old location code. From-SVN: r132679
2008-02-26re PR tree-optimization/26264 (Extraneous warning with ↵Manuel López-Ibáñez2-1/+5
__builtin_stdarg_start and optimization) 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 26264 * builtins.def (BUILT_IN_STDARG_START): Remove. * builtins.c (expand_builtin): Remove BUILT_IN_STDARG_START. * tree-stdarg.c (execute_optimize_stdarg): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. cp/ * call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START. testsuite/ * 20021023-1.c: Use __builtin_va_start instead of __builtin_stdarg_start. * pr17301-1.c: Likewise. * pr17301-2.c: Likewise. From-SVN: r132677
2008-02-26tree-flow.h (uid_decl_map_hash, [...]): Move ...Richard Guenther2-0/+6
2008-02-26 Richard Guenther <rguenther@suse.de> * tree-flow.h (uid_decl_map_hash, uid_decl_map_eq): Move ... * tree.h (uid_decl_map_hash, uid_decl_map_eq): ... here. (lookup_decl_from_uid): Declare. (remove_decl_from_map): Likewise. * tree-ssa.c (uid_decl_map_eq, uid_decl_map_hash): Move ... * tree.c (uid_decl_map_eq, uid_decl_map_hash): ... here. (decl_for_uid_map): New global hashtable mapping DECL_UID to the decl tree. (init_ttree): Allocate it. (insert_decl_to_uid_decl_map): New helper function. (make_node_stat): Insert new decls into the map. (copy_node_stat): Likewise. (lookup_decl_from_uid): New function. (remove_decl_from_map): Likewise. (print_decl_for_uid_map_statistics): New helper. (dump_tree_statistics): Call it. cp/ * decl.c (duplicate_decls): Remove decl from global mapping before ggc_freeing it. * tree-flow.h (struct gimple_df): Make referenced_vars a bitmap. (referenced_var_iterator): Adjust. (FOR_EACH_REFERENCED_VAR): Adjust. (FOR_EACH_REFERENCED_VAR_IN_BITMAP): New iterator. (num_referenced_vars): Adjust. * tree-flow-inline.h (gimple_referenced_vars): Adjust. (first_referenced_var): Remove. (end_referenced_vars_p): Likewise. (next_referenced_var): Likewise. (referenced_var_iterator_set): New helper function. * tree-dfa.c (referenced_var_lookup): Adjust. (referenced_var_check_and_insert): Likewise. (remove_referenced_var): Likewise. * tree-ssa.c (verify_flow_insensitive_alias_info): Use FOR_EACH_REFERENCED_VAR_IN_BITMAP. (verify_call_clobbering): Likewise. (verify_memory_partitions): Likewise. (init_tree_ssa): Allocate bitmap instead of hashtable for referenced_vars. (delete_tree_ssa): Adjust. * tree-ssa-alias.c (mark_aliases_call_clobbered): Use FOR_EACH_REFERENCED_VAR_IN_BITMAP. (compute_tag_properties): Likewise. (set_initial_properties): Likewise. (find_partition_for): Likewise. (update_reference_counts): Likewise. (dump_may_aliases_for): Likewise. * tree-ssa-operands.c (add_virtual_operand): Likewise. (add_call_clobber_ops): Likewise. (add_call_read_ops): Likewise. (get_asm_expr_operands): Likewise. * tree-into-ssa.c (dump_decl_set): Likewise. (update_ssa): Likewise. * tree-sra.c (scan_function): Likewise. (decide_instantiations): Likewise. (scalarize_parms): Likewise. * tree-ssa-alias-warnings.c (build_reference_table): Likewise. (dsa_named_for): Likewise. * tree-ssa-structalias.c (update_alias_info): Likewise. (merge_smts_into): Likewise. From-SVN: r132676
2008-02-26re PR c++/35323 (ICE calling functions with fixed-point type parameter)Paolo Carlini2-1/+7
/cp 2008-02-26 Paolo Carlini <pcarlini@suse.de> PR c++/35323 * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE. /testsuite 2008-02-26 Paolo Carlini <pcarlini@suse.de> PR c++/35323 * g++.dg/lookup/crash7.C: New. From-SVN: r132669
2008-02-25c-common.c (match_case_to_enum_1): Add appropriate OPT_W* parameter to warning.Manuel López-Ibáñez3-7/+15
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * c-common.c (match_case_to_enum_1): Add appropriate OPT_W* parameter to warning. (c_do_switch_warnings): Likewise. * c-typeck.c (warning_init): Add one more parameter following 'warning' function. (push_init_level): Update call to warning_init. (pop_init_level): Likewise. (add_pending_init): Likewise. (output_init_element: Likewise. cp/ * typeck.c (build_class_member_access_expr): Add appropriate OPT_W* parameter to warning. (build_reinterpret_cast_1): Likewise. * name-lookup.c (push_overloaded_decl): Likewise. testsuite/ * gcc.dg/Wswitch-enum-error.c: New. * gcc.dg/Wswitch-error.c: New. * gcc.dg/20011021-1.c: Use two directives to match two different messages. From-SVN: r132649
2008-02-25re PR c++/35333 (Broken diagnostic for complex builtin)Paolo Carlini2-0/+14
/cp 2008-02-25 Paolo Carlini <pcarlini@suse.de> PR c++/35333 * error.c (dump_expr): Handle CONJ_EXPR. /testsuite 2008-02-25 Paolo Carlini <pcarlini@suse.de> PR c++/35333 * g++.dg/other/error26.C: New. /cp 2008-02-25 Paolo Carlini <pcarlini@suse.de> PR c++/35338 * error.c (dump_type): Handle FIXED_POINT_TYPE. (dump_expr): Handle FIXED_CST. /testsuite 2008-02-25 Paolo Carlini <pcarlini@suse.de> PR c++/35338 * g++.dg/other/error25.C: New. From-SVN: r132634
2008-02-25re PR c++/33486 (namespace association doesn't handle parallel namespaces)Jason Merrill3-0/+44
* gcc/cp/parser.c (cp_parser_declaration): Handle 'inline namespace'. (cp_parser_namespace_definition): Likewise. PR c++/33486 * gcc/cp/name-lookup.c (arg_assoc_namespace): Look down into inline namespaces, too. * libstdc++-v3/include/bits/c++config: Use 'inline namespace' instead of strong using. From-SVN: r132611
2008-02-25typeck.c (check_for_casting_away_constness): Use 1 single argument, the type ↵Manuel López-Ibáñez2-35/+43
of cast, to decide what diagnostics generate. 2008-02-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * typeck.c (check_for_casting_away_constness): Use 1 single argument, the type of cast, to decide what diagnostics generate. (build_static_cast_1): Remove unused code. Update call to check_for_casting_away_constness. (build_reinterpret_cast_1): Update call to check_for_casting_away_constness. (build_const_cast_1): Likewise. From-SVN: r132609
2008-02-24error.c (dump_expr): Don't deal directly with NEW_EXPR (and VEC_NEW_EXPR), ↵Paolo Carlini3-46/+23
forward to pp_expression. 2008-02-24 Paolo Carlini <pcarlini@suse.de> * error.c (dump_expr): Don't deal directly with NEW_EXPR (and VEC_NEW_EXPR), forward to pp_expression. * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME. From-SVN: r132595
2008-02-24re PR c++/34749 (Incorrect warning when applying dllimport to friend function)Danny Smith2-7/+12
cp PR c++/34749 * friend.c (do_friend): Call cplus_decl_attributes earlier. testsuite PR c++/34749 * g++.dg.ext/dllimport13.C: New test. From-SVN: r132585
2008-02-22re PR c++/34715 (always_inline with templates and not declared as ↵Andrew Pinski2-0/+11
always_inline but definition has it) 2008-02-22 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/34715 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for template decls' function decl. 2008-02-22 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/34715 * g++.dg/ext/always_inline-1.C: New test. * g++.dg/ext/always_inline-2.C: New test. * g++.dg/ext/always_inline-3.C: New test. * g++.dg/ext/always_inline-4.C: New test. From-SVN: r132558
2008-02-22re PR c++/35282 (Template specialization rejected)Paolo Carlini2-3/+16
/testsuite 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 * g++.dg/template/nontype17.C: Add. /cp 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 2008-02-14 Paolo Carlini <pcarlini@suse.de> PR c++/28743 * pt.c (determine_specialization): In case of function templates, when the type of DECL does not match FN there is no match. /testsuite 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 2008-02-14 Paolo Carlini <pcarlini@suse.de> PR c++/28743 * g++.dg/template/nontype17.C: New. * g++.dg/template/nontype16.C: Add error. From-SVN: r132543
2008-02-22re PR c/19999 (-Wfloat-equal does not warn for complex numbers)Ralf Wildenhues2-1/+7
gcc/: PR c/19999 * c-typeck.c (build_binary_op): Warn about floating point comparisons if FLOAT_TYPE_P, not only for REAL_TYPE. gcc/cp/: * typeck.c (build_binary_op): Warn about floating point comparisons if FLOAT_TYPE_P, not only for REAL_TYPE. gcc/testsuite/: * gcc.dg/Wfloat-equal-1.c: New. * g++.dg/warn/Wfloat-equal-1.C: New. From-SVN: r132540
2008-02-19re PR c++/34950 (ICE in svn boost math toolkit)Jason Merrill2-0/+8
PR c++/34950 * pt.c (resolve_overloaded_unification): Set processing_template_decl while we look for possible bindings. From-SVN: r132455
2008-02-19re PR c++/35028 (ICE with strange ctor and firstprivate)Jakub Jelinek2-2/+6
PR c++/35028 * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors. * g++.dg/gomp/pr35028.C: New test. From-SVN: r132426
2008-02-19re PR c++/34964 (ICE with broken variable in #pragma omp threadprivate)Jakub Jelinek2-1/+11
PR c++/34964 PR c++/35244 * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p vars. Afterwards ensure v is VAR_DECL. * gcc.dg/gomp/pr34964.c: New test. * g++.dg/gomp/pr34964.C: New test. * gcc.dg/gomp/pr35244.c: New test. * g++.dg/gomp/pr35244.C: New test. From-SVN: r132425
2008-02-19re PR c++/35078 (ICE with reference in parallel for loop)Jakub Jelinek3-2/+23
PR c++/35078 * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't call cp_finish_decl. * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type early. * g++.dg/gomp/pr35078.C: New test. From-SVN: r132424
2008-02-15re PR c++/35023 (ICE with parameter pack in variable declaration)Douglas Gregor2-31/+38
2008-02-15 Douglas Gregor <doug.gregor@gmail.com> PR c++/35023 PR c++/35024 PR c++/35026 * pt.c (finish_member_template_decl): If the type in a TYPE_DECL is error_mark_node, return an error early. (find_parameter_packs_r): Pass the pointer set along to recursive calls of cp_walk_subtrees; don't try to manage the pointer set ourselves. (uses_parameter_packs): Pass the pointer set to cp_walk_tree. (make_pack_expansion): Ditto. (check_for_bare_parameter_packs): Ditto. Also, don't bother taking a second pass through the tree with find_parameter_packs_r; that second pass no longer does anything. (push_template_decl_real): If we have an erroneous declaration, set its type to error_mark_node before returning an error. 2008-02-15 Douglas Gregor <doug.gregor@gmail.com> PR c++/35023 PR c++/35024 PR c++/35026 * g++.dg/cpp0x/vt-35026.C: New. * g++.dg/cpp0x/vt-35023.C: New. * g++.dg/cpp0x/vt-34055.C: Tweak expected error messages. * g++.dg/cpp0x/vt-35024.C: New. From-SVN: r132348
2008-02-15re PR c++/34050 (ICE derived classes and variadic templates)Douglas Gregor2-30/+48
2008-02-14 Douglas Gregor <doug.gregor@gmail.com> PR c++/34050 * pt.c (tsubst_initializer_list): Deal with the use of VOID_TYPE_NODE to indicate value-initialization of the bases. 2008-02-14 Douglas Gregor <doug.gregor@gmail.com> PR c++/34050 * g++.dg/cpp0x/vt-34050.C: New. From-SVN: r132331
2008-02-14re PR c++/5645 (gcc warns that pure virtual class not explicitly initialized)Manuel López-Ibáñez4-4/+38
PR c++/5645 PR c++/11159 * class.c (type_has_user_nondefault_constructor): New fn. * cp-tree.h: Declare it. * init.c (emit_mem_initializers): Use it for -W warning about missing base initializer. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r132324