aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-16pt.c (tinst_level_tick, [...]): Replace with last_error_tinst_level.Jason Merrill1-20/+13
gcc/cp/ * pt.c (tinst_level_tick, last_template_error_tick): Replace with last_error_tinst_level. (push_tinst_level, pop_tinst_level): Adjust. (problematic_instantiation_changed): Adjust. (record_last_problematic_instantiation): Adjust. * error.c (cp_print_error_function): Don't print current_function_decl if we're in a template instantiation context. (print_instantiation_full_context): Always print first line. gcc/testsuite/ * lib/prune.exp (prune_gcc_output): Prune "In substitution" too. From-SVN: r176366
2011-07-04error.c (dump_template_bindings): Don't print typenames for a partial ↵Jason Merrill1-16/+37
instantiation. * error.c (dump_template_bindings): Don't print typenames for a partial instantiation. (dump_function_decl): If we aren't printing function arguments, print template arguments as <args> rather than [with ...]. (dump_expr): Don't print return type or template header. [BASELINK]: Use BASELINK_FUNCTIONS rather than get_first_fn. * pt.c (dependent_template_arg_p): Handle null arg. From-SVN: r175834
2011-07-04* error.c (type_to_string): Avoid redundant akas.Jason Merrill1-0/+14
From-SVN: r175833
2011-06-16re PR c++/49420 ([C++0x] compiler segfault using result_of)Jason Merrill1-1/+3
PR c++/49420 * error.c (dump_template_argument): Don't try to omit default template args from an argument pack. From-SVN: r175117
2011-06-14* error.c (type_to_string): Print typedef-stripped version too.Jason Merrill1-0/+9
From-SVN: r175045
2011-06-08re PR c++/49107 ([C++0x][4.7 Regression] incomplete type regression with ↵Jason Merrill1-1/+4
std::pair) PR c++/49107 * cp-tree.def (DEFERRED_NOEXCEPT): New. * cp-tree.h (struct tree_deferred_noexcept): New. (DEFERRED_NOEXCEPT_PATTERN, DEFERRED_NOEXCEPT_ARGS): New. (DEFERRED_NOEXCEPT_SPEC_P): New. (enum cp_tree_node_structure_enum): Add TS_CP_DEFERRED_NOEXCEPT. (union lang_tree_node): Add tree_deferred_noexcept. (maybe_instantiate_noexcept): Declare. * cp-objcp-common.c (cp_tree_size): Handle DEFERRED_NOEXCEPT. * error.c (dump_exception_spec): Likewise. * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise. * ptree.c (cxx_print_xnode): Likewise. * tree.c (cp_tree_equal): Likewise. * decl.c (cp_tree_node_structure): Likewise. (duplicate_decls): Call maybe_instantiate_noexcept. * except.c (build_noexcept_spec): Handle DEFERRED_NOEXCEPT. (nothrow_spec_p, type_noexcept_p, type_throw_all_p): Check DEFERRED_NOEXCEPT_SPEC_P. * typeck2.c (merge_exception_specifiers): Likewise. * decl2.c (mark_used): Call maybe_instantiate_noexcept. * method.c (process_subob_fn, defaulted_late_check): Likewise. * pt.c (tsubst_exception_specification): Add defer_ok parm. Build DEFERRED_NOEXCEPT. (maybe_instantiate_noexcept): New. (tsubst, regenerate_decl_from_template, instantiate_decl): Adjust. * search.c (check_final_overrider): Call maybe_instantiate_noexcept. From-SVN: r174820
2011-06-07re PR c++/48969 (ICE with -std=c++0x)Jason Merrill1-23/+46
PR c++/48969 PR c++/44175 gcc/c-family/ * c-common.c (max_tinst_depth): Lower default to 900. gcc/cp/ * error.c (subst_to_string): New. (cp_printer): Use it for 'S'. (print_instantiation_partial_context_line): Handle subst context. * pt.c (push_tinst_level): Handle subst context. (deduction_tsubst_fntype): Don't track specific substitutions. Use push_tinst_level. From-SVN: r174772
2011-05-27re PR c++/48284 ([C++0x] incorrect printing of decltype operand in diagnostic)Jason Merrill1-1/+4
PR c++/48284 * error.c (dump_expr) [COMPONENT_REF]: Use pp_cxx_dot with INDIRECT_REF of REFERENCE_TYPE. From-SVN: r174353
2011-05-25re PR c++/49156 ([C++0x] Error reporting routines re-entered)Jason Merrill1-0/+5
PR c++/49156 * error.c (dump_template_bindings): Set processing_template_decl for a partial instantiation. From-SVN: r174256
2011-05-23re PR c++/47336 ([C++0x] ICE: "Error reporting routines re-entered")Jason Merrill1-0/+2
PR c++/47336 * error.c (dump_template_bindings): Suppress access control. From-SVN: r174072
2011-05-06introduce {class,type}_of_this_parm functionsNathan Froyd1-4/+2
introduce {class,type}_of_this_parm functions * cp-tree.h (type_of_this_parm, class_of_this_parm): New functions. * call.c (standard_conversion): Call class_of_this_parm. * cxx-pretty-print.c (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_direct_abstract_declarator): Likewise. * decl2.c (change_return_type): Likewise. (cp_reconstruct_complex_type): Likewise. * error.c (dump_type_suffix, dump_function_decl): Likewise. * mangle.c (write_function_type): Likewise. * pt.c (unify): Likewise. * typeck.c (merge_types, type_memfn_quals): Likewise. * decl.c (build_this_parm): Call type_of_this_parm. From-SVN: r173496
2011-04-25c-common.c (struct c_common_resword): Add __underlying_type.Paolo Carlini1-1/+12
/gcc 2011-04-25 Paolo Carlini <paolo.carlini@oracle.com> * c-family/c-common.c (struct c_common_resword): Add __underlying_type. * c-family/c-common.h (enum rid): Add RID_UNDERLYING_TYPE. /cp 2011-04-25 Paolo Carlini <paolo.carlini@oracle.com> * cp-tree.def: Add a new UNDERLYING_TYPE tree code. * cp-tree.h (enum cp_trait_kind): Add CPTK_UNDERLYING_TYPE, tidy. (UNDERLYING_TYPE_TYPE): Add. * cp-objcp-common.c (cp_common_init_ts): Mark UNDERLYING_TYPE as TS_COMMON. * parser.c (cp_lexer_next_token_is_decl_specifier_keyword, cp_parser_simple_type_specifier): Handle UNDERLYING_TYPE. (cp_parser_trait_expr): Deal with RID_UNDERLYING_TYPE; tidy. * semantics.c (finish_underlying_type): New. * typeck.c (structural_comptypes): Handle UNDERLYING_TYPE. * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise. * cxx-pretty-print.c (p_cxx_type_id): Likewise. * tree.c (cp_walk_subtrees): Likewise. * pt.c (for_each_template_parm_r, tsubst, unify, dependent_type_p_r): Likewise. * mangle.c (write_type): Sorry for __underlying_type. * doc/extend.texi: Document __underlying_type. /testsuite 2011-04-25 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/ext/underlying_type1.C: New. * g++.dg/ext/underlying_type2.C: Likewise. * g++.dg/ext/underlying_type3.C: Likewise. * g++.dg/ext/underlying_type4.C: Likewise. * g++.dg/ext/underlying_type5.C: Likewise. * g++.dg/ext/underlying_type6.C: Likewise. * g++.dg/ext/underlying_type7.C: Likewise. * g++.dg/ext/underlying_type8.C: Likewise. * g++.dg/ext/underlying_type9.C: Likewise. * g++.dg/ext/underlying_type10.C: Likewise. From-SVN: r172943
2011-03-21ChangeLog gcc/c-familyKai Tietz1-0/+2
2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * c-pretty-print.c (pp_c_specifier_qualifier_list): Display allowed attributes for function pointer types. (pp_c_attributes_display): New function to display attributes having affects_type_identity flag set to true. * c-pretty-print.h (pp_c_attributes_display): New prototype. ChangeLog gcc/cp 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * cxx-pretty-print.c (pp_cxx_ptr_operator): Display allowed attributes for function pointer types. * error.c (dump_type_prefix): Likewise. From-SVN: r171210
2011-02-20re PR c++/47703 ([C++0x] ICE: std::sort chokes on simple lambda function)Jason Merrill1-1/+5
PR c++/47703 * error.c (location_of): Handle non-tagged types. From-SVN: r170349
2010-12-14re PR c++/45330 (Suggest likely nested-name-specifiers for undeclared ↵Nathan Froyd1-0/+36
identifiers.) gcc/cp/ PR c++/45330 * cp-tree.h (suggest_alternatives_for): Add location_t parameter. * name-lookup.c (suggest_alternatives_for): Likewise. Adjust. * lex.c (unqualified_name_lookup_error): Adjust call to it. * semantics.c (qualified_name_lookup_error): Move to... * error.c (qualified_name_lookup_error): ...here. Call. suggest_alternatives_for. gcc/testsuite/ PR c++/45330 * g++.dg/lookup/suggestions1.C: New test. From-SVN: r167814
2010-12-10decl.c (grokmethod): Test DECL_CLASS_SCOPE_P.Nathan Froyd1-1/+1
* decl.c (grokmethod): Test DECL_CLASS_SCOPE_P. * error.c (dump_decl): Test DECL_FILE_SCOPE_P. From-SVN: r167691
2010-12-07re PR c++/45330 (Suggest likely nested-name-specifiers for undeclared ↵Nathan Froyd1-2/+2
identifiers.) gcc/ PR c++/45330 * params.def (CXX_MAX_NAMESPACES_FOR_DIAGNOSTIC_HELP): New parameter. * doc/invoke.texi (cxx-max-namespaces-for-diagnostic-help): Document. gcc/cp/ PR c++/45330 * cp-tree.h (suggest_alternatives_for, location_of): Declare. * error.c (dump_expr): Handle TYPE_DECL. (location_of): Unstaticize. * name-lookup.c (suggest_alternatives_for): New function. * lex.c (unqualified_name_lookup_error): Call it. gcc/testsuite/ PR c++/45330 * g++.dg/pr45330.C: New test. * g++.dg/ext/builtin3.C: Adjust. * g++.dg/lookup/error1.C: Adjust. * g++.dg/lookup/koenig5.C: Adjust. * g++.dg/overload/koenig1.C: Adjust. * g++.dg/parse/decl-specifier-1.C: Adjust. * g++.dg/template/static10.C: Adjust. * g++.old-deja/g++.mike/ns5.C: Adjust. * g++.old-deja/g++.mike/ns7.C: Adjust. * g++.old-deja/g++.ns/koenig5.C: Adjust. * g++.old-deja/g++.ns/koenig9.C: Adjust. * g++.old-deja/g++.other/lineno5.C: Adjust. From-SVN: r167536
2010-12-06In gcc/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-0/+1
In gcc/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com> * c-family/c-common.h: Removed the declarations of all the objc_ callbacks, and moved them into c-objc.h. Removed objc_ivar_visibility_kind and moved it into c-objc.h. * c-family/c-objc.h: New file. * c-family/c-common.c: Include c-objc.h. * c-family/c-format.c: Same change. * c-family/stub-objc.c: Same change. * c-decl.c: Include c-family/c-objc.h. * c-parser.c: Same change. * c-typeck.c: Same change. * c-config-lang.in (gtfiles): Added c-family/c-objc.h. * Makefile.in (c-decl.o): Depend on c-family/c-objc.h. (c-parser.o): same change. (c-typeck.o): Same change. (c-family/c-format.o): Same change. (c-family/stub-objc.o): Same change. (c-family/c-common.o): Same change. (PLUGIN_HEADERS): Added c-family/c-objc.h. In gcc/cp/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com> * call.c: Include c-family/c-objc.h. * decl.c: Same change. * decl2.c: Same change. * error.c: Same change. * lex.c: Same change. * parser.c: Same change. * pt.c: Same change. * semantics.c: Same change. * typeck.c: Same change. * Make-lang.in (cp/decl.o): Depend on c-family/c-objc.h. (cp/decl2.o): Same change. (cp/call.o): Same change. (cp/error.o): Same change. (cp/lex.o): Same change. (cp/parser.o): Same change. (cp/pt.o): Same change. (cp/semantics.o): Same change. (cp/typeck.o): Same change. * config-lang.in (gtfiles): Added c-family/c-objc.h. In gcc/objc/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c: Include c-family/c-objc.h. * objc-lang.c: Same change. * Make-lang.in (objc/objc-act.o): Depend on c-family/c-objc.h. (objc/objc-lang.o): Same change. * config-lang.in (gtfiles): Added c-family/c-objc.h. In gcc/objcp/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com> * config-lang.in (gtfiles): Added c-family/c-objc.h. * Make-lang.in (objcp/objcp-act.o): Depend on c-family/c-objc.h. (objcp/objcp-lang.o): Same change. (objcp/objcp-decl.o): Same change. * objcp-lang.c: Include c-family/c-objc.h. * objcp-decl.c: Same change. From-SVN: r167481
2010-12-03re PR middle-end/46745 ('#'mem_ref' not supported by dump_expr#<expression ↵Richard Guenther1-0/+28
error>') 2010-12-03 Richard Guenther <rguenther@suse.de> PR c/46745 * c-pretty-print.c (pp_c_postfix_expression): Handle MEM_REF. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. cp/ * error.c (dump_expr): Handle MEM_REF. From-SVN: r167433
2010-11-30diagnostic-core.h: Include bversion.h.Joseph Myers1-1/+0
* diagnostic-core.h: Include bversion.h. * toplev.h: Don't include input.h or bversion.h. (parse_optimize_options): Don't declare here. * alias.c, auto-inc-dec.c, c-aux-info.c, c-convert.c, c-parser.c, caller-save.c, cfg.c, cfganal.c, cfgbuild.c, cfgcleanup.c, combine-stack-adj.c, config/arm/pe.c, config/darwin-c.c, config/host-darwin.c, config/i386/host-cygwin.c, config/i386/host-mingw32.c, config/i386/msformat-c.c, config/i386/netware.c, config/i386/nwld.c, config/i386/winnt-cxx.c, config/i386/winnt-stubs.c, config/ia64/ia64-c.c, config/m32c/m32c-pragma.c, config/mep/mep-pragma.c, config/microblaze/microblaze-c.c, config/rs6000/host-darwin.c, config/rs6000/rs6000-c.c, config/score/score3.c, config/score/score7.c, config/sh/symbian-base.c, config/sh/symbian-c.c, config/sh/symbian-cxx.c, config/sol2-c.c, config/sol2.c, config/v850/v850-c.c, config/vxworks.c, convert.c, cppbuiltin.c, cselib.c, dbgcnt.c, ddg.c, dfp.c, dominance.c, emit-rtl.c, fixed-value.c, fwprop.c, ggc-common.c, gimple.c, gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-flattening.c, graphite-interchange.c, graphite-poly.c, graphite-scop-detection.c, graphite.c, haifa-sched.c, implicit-zee.c, integrate.c, ipa-pure-const.c, ipa-reference.c, ira-build.c, ira-conflicts.c, ira-costs.c, ira-lives.c, jump.c, lists.c, loop-doloop.c, loop-iv.c, lto-cgraph.c, lto-compress.c, lto-opts.c, lto-section-in.c, lto-section-out.c, lto-streamer-out.c, lto-symtab.c, modulo-sched.c, optabs.c, params.c, postreload-gcse.c, postreload.c, predict.c, profile.c, regcprop.c, reginfo.c, regmove.c, reorg.c, resource.c, sched-deps.c, sched-ebb.c, sched-rgn.c, sdbout.c, sel-sched-dump.c, sel-sched-ir.c, sese.c, stmt.c, targhooks.c, tree-cfgcleanup.c, tree-mudflap.c, tree-nomudflap.c, tree-object-size.c, tree-outof-ssa.c, tree-phinodes.c, tree-profile.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-live.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-operands.c, tree-ssa-structalias.c, tree-ssa-uninit.c, tree-vect-patterns.c, value-prof.c, var-tracking.c, web.c: Don't include toplev.h. * Makefile.in (TOPLEV_H): Remove. All uses changed to use toplev.h. Dependencies for above files and c-family files changed to remove $(TOPLEV_H) or toplev.h. (C_TREE_H): Don't include $(TOPLEV_H). (DIAGNOSTIC_CORE_H): Use $(INPUT_H) instead of input.h. Add bversion.h. * config/arm/t-pe, config/arm/t-wince-pe, config/i386/t-cygming, config/ia64/t-ia64, config/mep/t-mep, config/score/t-score-elf, config/t-darwin, config/t-sol2, config/t-vxworks, config/v850/t-v850, config/v850/t-v850e: Dependencies for above files changed to remove $(TOPLEV_H) or toplev.h. c-family: * c-common.h (parse_optimize_options): Declare. * c-cppbuiltin.c, c-format.c, c-gimplify.c, c-lex.c, c-omp.c, c-pch.c, c-pragma.c, c-semantics.c: Don't include toplev.h. cp: * cp-gimplify.c, cp-lang.c, cvt.c, cxx-pretty-print.c, error.c, except.c, expr.c, friend.c, init.c, mangle.c, name-lookup.c, optimize.c, parser.c, rtti.c, tree.c, typeck2.c: Don't include toplev.h. * Make-lang.in: Dependencies for above files changed to remove toplev.h. java: * expr.c, lang.c, mangle.c, mangle_name.c, typeck.c, verify-glue.c: Don't include toplev.h. * Make-lang.in: Dependencies for above files changed to remove toplev.h. lto: * Make-lang.in (lto/lto-object.o): Depend on toplev.h instead of $(TOPLEV_H). From-SVN: r167293
2010-11-24revert accidentally committed changesNathan Froyd1-1/+0
From-SVN: r167130
2010-11-24cppbuiltin.c (define_builtin_macros_for_type_sizes): Define ↵Nathan Froyd1-0/+1
__FLOAT_WORD_ORDER__ according to FLOAT_WORDS_BIG_ENDIAN. gcc/ * cppbuiltin.c (define_builtin_macros_for_type_sizes): Define __FLOAT_WORD_ORDER__ according to FLOAT_WORDS_BIG_ENDIAN. * config/dfp-bit.h (LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Delete. * doc/cpp.texi (__FLOAT_WORD_ORDER__): Document. * system.h (LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Poison. libgcc/ * config/libbid/bid_conf.h (BID_BIG_ENDIAN): Define in terms of __FLOAT_WORD_ORDER__. * config/libbid/bid_gcc_intrinsics.h (LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Delete. libdecnumber/ * dconfig.h (LIBGCC2_FLOAT_WORDS_BIG_ENDIAN): Delete. (WORDS_BIG_ENDIAN): Define based on value of __FLOAT_WORD_ORDER__. From-SVN: r167129
2010-11-08Correct conversion/overflow behavior.Jason Merrill1-1/+3
* cvt.c (ignore_overflows): Move here from typeck.c. (ocp_convert): Use it. (cp_fold_convert): Use it. Don't call rvalue. * typeck.c (build_static_cast_1): Don't use it. Do call rvalue. * error.c (location_of): Handle expressions, too. * class.c (check_bitfield_decl): Set input_location around call to cxx_constant_value. * semantics.c (cxx_eval_outermost_constant_expr): Don't print the expression if it already had TREE_OVERFLOW set. (reduced_constant_expression_p): Check TREE_OVERFLOW_P for C++98, too. (verify_constant): Allow overflow with a permerror if we're enforcing. (cxx_eval_outermost_constant_expr): Use verify_constant. (adjust_temp_type): Use cp_fold_convert. * decl.c (build_enumerator): Don't call constant_expression_warning. * decl2.c (grokbitfield): Likewise. From-SVN: r166453
2010-11-01semantics.c (call_stack, [...]): New.Jason Merrill1-0/+27
* semantics.c (call_stack, call_stack_tick, cx_error_context): New. (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New. (cxx_eval_call_expression): Call push/pop_cx_call_context instead of giving follow-on errors. * error.c (maybe_print_constexpr_context): New. (cp_diagnostic_starter): Call it. * cp-tree.h: Declare cx_error_context. From-SVN: r166169
2010-10-27* error.c (dump_simple_decl): Print constexpr.Jason Merrill1-6/+13
From-SVN: r166010
2010-10-24In gcc/cp/: 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-0/+12
In gcc/cp/: 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com> Removed Objective-C++ specific replacement of cxx_printable_name. * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set to cxx_printable_name for both C++ and Objective-C++. * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME. * error.c (dump_decl): For Objective-C++, call objc_maybe_printable_name here ... * tree.c (cxx_printable_name_internal): ... instead of here. In gcc/objcp/: 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com> * objcp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Do not define. In gcc/objc/: 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c (objc_build_keyword_decl): Updated comments. Do not emit a warning that method parameter attributes are unimplemented. Instead, store them into DECL_ATTRIBUTES of the KEYWORD_DECL. (start_method_def): Copy attributes from each KEYWORD_DECL into the corresponding PARM_DECL. (objc_warn_deprecated_use): Removed. (build_objc_method_call): Call warn_deprecated_use, not objc_warn_deprecated_use. (objc_maybe_printable_name): Do not try to get the identifier name of DECLs that we don't recognize. Immediately return NULL for them. (objc_printable_name): Removed C++-specific case, which is no longer used. Updated comments. In gcc/testsuite/: 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/attributes/method-attribute-2.m: Updated test. Method parameter attributes are now supported. * obj-c++.dg/attributes/method-attribute-2.m: Same change. * objc.dg/attributes/parameter-attribute-1.m: New test. * objc.dg/attributes/parameter-attribute-2.m: New test. * obj-c++.dg/attributes/parameter-attribute-1.m: New test. * obj-c++.dg/attributes/parameter-attribute-2.m: New test. From-SVN: r165896
2010-10-14re PR c++/44561 (using nullptr_t with -flto/-fwhopr causes ICE: tree code ↵Richard Guenther1-0/+6
'lang_type' is not supported in gimple streams) 2010-10-14 Richard Guenther <rguenther@suse.de> PR lto/44561 * tree.def (NULLPTR_TYPE): New tree code. * dbxout.c (dbxout_type): Handle NULLPTR_TYPE. * dwarf2out.c (is_base_type): Likewise. (gen_type_die_with_usage): Likewise. * sdbout.c (plain_type_1): Likewise. * tree.c (build_int_cst_wide): Likewise. * gimple.c (gimple_types_compatible_p_1): NULLPTR_TYPE types are equal. cp/ * cp-tree.h (NULLPTR_TYPE_P): Adjust. * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node, use build_int_cst. * error.c (dump_type): Handle NULLPTR_TYPE. (dump_type_prefix): Likewise. (dump_type_suffix): Likewise. * mangle.c (write_type): Likewise. * name-lookup.c (arg_assoc_type): Likewise. * rtti.c (typeinfo_in_lib_p): Likewise. * pt.c (tsubst): Likewise. * g++.dg/lto/20101010-3_0.C: New testcase. * g++.dg/lto/20101010-4_0.C: Likewise. From-SVN: r165462
2010-10-07In gcc/testsuite/: 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-0/+8
In gcc/testsuite/: 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com> * obj-c++.dg/encode-10.mm: New testcase. In gcc/cp/: 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com> * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to tcc_expression. * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for AT_ENCODE_EXPR. * error.c (dump_expr): Added case for AT_ENCODE_EXPR. * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR. (value_dependent_expression_p): Added case for AT_ENCODE_EXPR. (type_dependent_expression_p): Added case for AT_ENCODE_EXPR. * parser.c (cp_parser_objc_encode_expression): Updated comment. From-SVN: r165138
2010-09-24error.c (dump_expr): Print conversion between reference and pointer to the ↵Jason Merrill1-2/+15
same type as "*" or "&". * error.c (dump_expr) [CASE_CONVERT]: Print conversion between reference and pointer to the same type as "*" or "&". From-SVN: r164597
2010-09-10re PR c++/43824 (C++0x feature "inline namespace" enabled under -std=c++98; ↵Rodrigo Rivas Costa1-0/+5
no warnings) PR c++/43824 * error.c (maybe_warn_cpp0x): Add new warning CPP0X_INLINE_NAMESPACES. * parser.c (cp_parser_namespace_definition): Likewise. * cp-tree.h (cpp0x_warn_str): Likewise. From-SVN: r164201
2010-08-20vec.h (FOR_EACH_VEC_ELT): Define.Nathan Froyd1-1/+1
gcc/ * vec.h (FOR_EACH_VEC_ELT): Define. * c-decl.c: Use it. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/bfin/bfin.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * dbxout.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * ggc-common.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * ipa-prop.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * lambda-code.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-opts.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-symtab.c: Likewise. * matrix-reorg.c: Likewise. * opts.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-data-ref.c: Likewise. * tree-emutls.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * vmsdbgout.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Use FOR_EACH_VEC_ELT. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. gcc/c-family/ * c-common.c: Use FOR_EACH_VEC_ELT. * c-gimplify.c: Likewise. * c-pragma.c: Likewise. gcc/cp/ * call.c: Use FOR_EACH_VEC_ELT. * class.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * error.c: Likewise. * except.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * repo.c: Likewise. * semantics.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * trans-openmp.c: Use FOR_EACH_VEC_ELT. gcc/java/ * class.c: Use FOR_EACH_VEC_ELT. * expr.c: Likewise. * jcf-parse.c: Likewise. * resource.c: Likewise. gcc/lto/ * lto.c: Use FOR_EACH_VEC_ELT. From-SVN: r163401
2010-07-06* error.c (dump_function_decl): Don't crash on null DECL_NAME.Jason Merrill1-1/+1
From-SVN: r161878
2010-06-22re PR c++/44627 (ICE in dump_expr, at cp/error.c:1735)Jakub Jelinek1-1/+3
PR c++/44627 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if the CALL_EXPR has no arguments. * g++.dg/diagnostic/method1.C: New test. From-SVN: r161227
2010-06-17re PR c++/44486 (missing space in __PRETTY_FUNCTION__ expansion in anonymous ↵Manuel López-Ibáñez1-1/+1
namespace) 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c++/44486 cp/ * error.c (dump_decl): Better wording for anonymous namespace. testsuite/ * g++.dg/pr44486.C: New. From-SVN: r160877
2010-06-08re PR c++/44366 ([C++0x] g++ crashes when declaring a lambda expression ↵Jason Merrill1-1/+3
using a typedef'd decltype.) PR c++/44366 * error.c (dump_parameters): Mask out TFF_SCOPE. (dump_simple_decl): Don't print the scope of a PARM_DECL. (dump_scope): Remove no-op mask. From-SVN: r160420
2010-06-04Implement noexcept-specification (15.4)Jason Merrill1-1/+17
Implement noexcept-specification (15.4) * parser.c (cp_parser_exception_specification_opt): Parse it. Give -Wdeprecated warning about throw() specs. * pt.c (tsubst_exception_specification): Handle it. * error.c (dump_exception_spec): Handle it. * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise. * typeck.c (comp_except_specs): Handle compatibility rules. Change exact parm to take an enum. * typeck2.c (merge_exception_specifiers): Handle noexcept. * except.c (nothrow_spec_p, type_noexcept_p): New fns. (type_throw_all_p, build_noexcept_spec): New fns. * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them. (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums. (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC. (noexcept_true_spec, noexcept_false_spec): New macros. * name-lookup.c (pushdecl_maybe_friend): Adjust. * search.c (check_final_overrider): Adjust. * decl.c (check_redeclaration_exception_specification): Adjust. (use_eh_spec_block): Use type_throw_all_p. (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec. Give operator new a noexcept-specification in C++0x mode. * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust. (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS. From-SVN: r160298
2010-06-02* error.c (dump_type): Improve typedef handling.Jason Merrill1-0/+19
From-SVN: r160184
2010-05-24diagnostic.c: Don't include flags.h.Joseph Myers1-5/+6
* diagnostic.c: Don't include flags.h. (pedantic_warning_kind, permissive_error_kind): Take diagnostic context parameters. Check flags in the context passed as a parameter. (diagnostic_build_prefix): Add context parameter. Check show_column flag in context. (diagnostic_action_after_output): Check fatal_errors flag in context. (diagnostic_report_current_module): Check show_column flag in context. (default_diagnostic_starter): Update call to diagnostic_build_prefix. (diagnostic_report_diagnostic): Pass context to pedantic_warning_kind. (emit_diagnostic): Pass context to permissive_error_kind. (permerror): Pass context to permissive_error_kind. * diagnostic.h (struct diagnostic_context): Add show_column, pedantic_errors, permissive and fatal_errors fields. (diagnostic_build_prefix): Update prototype. * langhooks.c * toplev.c (process_options): Set flags in global_dc from flag_show_column, flag_pedantic_errors, flag_permissive, flag_fatal_errors. * tree-diagnostic.c (default_tree_diagnostic_starter): Update call to diagnostic_build_prefix. * Makefile.in (diagnostic.o): Update dependencies. cp: * error.c (cp_diagnostic_starter): Update call to diagnostic_build_prefix. (cp_print_error_function, print_instantiation_partial_context_line): Check show_column flag in context. From-SVN: r159793
2010-05-21diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or ↵Joseph Myers1-3/+9
langhooks-def.h. * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. (diagnostic_initialize): Initialize x_data not last_function. (diagnostic_report_current_function): Move to tree-diagnostic.c. (default_diagnostic_starter): Call diagnostic_report_current_module not diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize x_data not abstract_origin. (verbatim): Likewise. * diagnostic.h (struct diagnostic_info): Change abstract_origin to x_data. (struct diagnostic_context): Change last_function to x_data. (diagnostic_auxiliary_data): Replace with diagnostic_context_auxiliary_data and diagnostic_info_auxiliary_data. (diagnostic_last_function_changed, diagnostic_set_last_function, diagnostic_report_current_function): Move to tree-diagnostic.h. (print_declaration, dump_generic_node, print_generic_stmt, print_generic_stmt_indented, print_generic_expr, print_generic_decl, debug_c_tree, dump_omp_clauses, print_call_name, debug_generic_expr, debug_generic_stmt, debug_tree_chain, default_tree_printer): Move to tree-pretty-print.h. (debug_gimple_stmt, debug_gimple_seq, print_gimple_seq, print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to gimple-pretty-print.h. * pretty-print.c: Don't include tree.h (pp_base_format): Don't handle %K here. (pp_base_tree_identifier): Move to tree-pretty-print.c. * pretty-print.h (text_info): Change abstract_origin to x_data. (pp_tree_identifier, pp_unsupported_tree, pp_base_tree_identifier): Move to tree-pretty-print.h. * gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h, tree-pretty-print.h: New files. * tree-pretty-print.c: Include tree-pretty-print.h. (percent_K_format): New. Moved from pretty-print.c. (pp_base_tree_identifier): Move from pretty-print.c. * c-objc-common.c: Include tree-pretty-print.h. (c_tree_printer): Handle %K here. * langhooks.c: Include tree-diagnostic.h. (lhd_print_error_function): Use diagnostic_abstract_origin macro. * toplev.c: Include tree-diagnostic.h and tree-pretty-print.h. (default_tree_printer): Handle %K using percent_K_format. (general_init): Use default_tree_diagnostic_starter. * tree.c: Include tree-diagnostic.h and tree-pretty-print.h. (free_lang_data): Use default_tree_diagnostic_starter. * c-pretty-print.c: Include tree-pretty-print.h. * cfgexpand.c: Include tree-pretty-print.h and gimple-pretty-print.h. * cgraphunit.c: Include tree-pretty-print.h and gimple-pretty-print.h. * dwarf2out.c: Include tree-pretty-print.h. * except.c: Include tree-pretty-print.h. * gimple-pretty-print.c: Include tree-pretty-print.h and gimple-pretty-print.h. * gimplify.c: Include tree-pretty-print.h. * graphite-poly.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-cp.c: Include tree-pretty-print.h. * ipa-inline.c: Include gimple-pretty-print.h. * ipa-prop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-pure-const.c: Include gimple-pretty-print.h. * ipa-struct-reorg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-type-escape.c: Include tree-pretty-print.h. * print-rtl.c: Include tree-pretty-print.h. * print-tree.c: Include gimple-pretty-print.h. * sese.c: Include tree-pretty-print.h. * tree-affine.c: Include tree-pretty-print.h. * tree-browser.c: Include tree-pretty-print.h. * tree-call-cdce.c: Include gimple-pretty-print.h. * tree-cfg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-chrec.c: Include tree-pretty-print.h. * tree-data-ref.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-dfa.c: Include tree-pretty-print.h. * tree-if-conv.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-inline.c: Include tree-pretty-print.h. * tree-into-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-nrv.c: Include tree-pretty-print.h. * tree-object-size.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-outof-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-parloops.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-predcom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-scalar-evolution.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-sra.c: Include tree-pretty-print.h. * tree-ssa-address.c: Include tree-pretty-print.h. * tree-ssa-alias.c: Include tree-pretty-print.h. * tree-ssa-ccp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-coalesce.c: Include tree-pretty-print.h. * tree-ssa-copy.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-copyrename.c: Include tree-pretty-print.h. * tree-ssa-dce.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dse.c: Include gimple-pretty-print.h. * tree-ssa-forwprop.c: Include tree-pretty-print.h. * tree-ssa-ifcombine.c: Include tree-pretty-print.h. * tree-ssa-live.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-im.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-niter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-prefetch.c: Include tree-pretty-print.h. * tree-ssa-math-opts.c: Include gimple-pretty-print.h. * tree-ssa-operands.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-phiprop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-pre.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-propagate.c: Include gimple-pretty-print.h. * tree-ssa-reassoc.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sccvn.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sink.c: Include gimple-pretty-print.h. * tree-ssa-ter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-uninit.c: Include gimple-pretty-print.h. * tree-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-stdarg.c: Include gimple-pretty-print.h. * tree-switch-conversion.c: Include gimple-pretty-print.h. * tree-tailcall.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-data-refs.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop-manip.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-patterns.c: Include gimple-pretty-print.h. * tree-vect-slp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-stmts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vectorizer.c: Include tree-pretty-print.h. * tree-vrp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * value-prof.c: Include tree-pretty-print.h and gimple-pretty-print.h. * var-tracking.c: Include tree-pretty-print.h. * Makefile.in (OBJS-common): Add tree-diagnostic.o. (tree-diagnostic.o): New dependencies. (c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o, tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o, tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o, tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o, tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o, tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o, tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o, tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o, tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o, tree-ssa-address.o, tree-ssa-loop-niter.o, tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o, tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o, tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o, gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o, tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o, tree-parloops.o, tree-stdarg.o, tree-object-size.o, gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o, toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o, ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o, ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o, tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o, tree-switch-conversion.o, var-tracking.o, value-prof.o, cfgexpand.o, pretty-print.o): Update dependencies. cp: * error.c: Include tree-diagnostic.h and tree-pretty-print.h. (cp_print_error_function): Use diagnostic_abstract_origin macro. (cp_printer): Handle %K here using percent_K_format. * cxx-pretty-print.c: Include tree-pretty-print.h. * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update dependencies. From-SVN: r159685
2010-05-21tree.h: Include real.h and fixed-value.h as basic datatypes.Steven Bosscher1-1/+0
gcc/ChangeLog: * tree.h: Include real.h and fixed-value.h as basic datatypes. * dfp.c, convert.c, reload1.c, reginfo.c, tree-flow.h, tree-ssa-threadedge.c, tree-ssanames.c, tree-loop-linear.c, tree-into-ssa.c, tree-vect-generic.c, tree-ssa-structalias.c, tree-ssa-loop-im.c, tree-dump.c, tree-complex.c, tree-ssa-uninit.c, genrecog.c, tree-ssa-threadupdate.c, tree-ssa-loop-niter.c, tree-pretty-print.c, tree-loop-distribution.c, tree-ssa-loop-unswitch.c, c-lex.c, optabs.c, postreload-gcse.c, tree-ssa-loop-manip.c, postreload.c, tree-ssa-loop-ch.c, tree-tailcall.c, tree.c, reload.c, tree-scalar-evolution.c, rtlanal.c, tree-phinodes.c, builtins.c, final.c, genoutput.c, fold-const.c, tree-ssa-dse.c, genautomata.c, tree-ssa-uncprop.c, toplev.c, tree-chrec.c, genemit.c, c-cppbuiltin.c, tree-ssa-sccvn.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, mode-switching.c, tree-call-cdce.c, cse.c, genpeep.c, tree-ssa-math-opts.c, tree-ssa-dom.c, tree-nrv.c, tree-ssa-propagate.c, tree-ssa-alias.c, tree-ssa-sink.c, jump.c, ifcvt.c, dwarf2out.c, expr.c, genattrtab.c, genconditions.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop.c, tree-parloops.c, recog.c, tree-ssa-address.c, lcm.c, tree-eh.c, gimple-pretty-print.c, c-pretty-print.c, print-rtl.c, gcse.c, tree-if-conv.c, tree-data-ref.c, tree-affine.c, gimplify.c, tree-ssa-phiopt.c, implicit-zee.c, expmed.c, tree-dfa.c, emit-rtl.c, store-motion.c, cselib.c, tree-cfgcleanup.c, simplify-rtx.c, tree-ssa-pre.c, genpreds.c, tree-mudflap.c, print-tree.c, tree-ssa-copy.c, tree-ssa-forwprop.c, tree-ssa-dce.c, varasm.c, tree-nested.c, tree-ssa.c, tree-ssa-loop-prefetch.c, rtl.c, tree-inline.c, integrate.c, tree-optimize.c, tree-ssa-phiprop.c, fixed-value.c, combine.c, tree-profile.c, c-common.c, sched-vis.c, tree-cfg.c, passes.c, tree-ssa-reassoc.c, config/alpha/alpha.c, config/frv/frv.c, config/s390/s390.c, config/m32c/m32c.c, config/spu/spu.c, config/sparc/sparc.c, config/mep/mep.c, config/m32r/m32r.c, config/rx/rx.c, config/i386/i386.c, config/sh/sh.c, config/pdp11/pdp11.c, config/avr/avr.c, config/crx/crx.c, config/xtensa/xtensa.c, config/stormy16/stormy16.c, config/fr30/fr30.c, config/lm32/lm32.c, config/moxie/moxie.c, config/m68hc11/m68hc11.c, config/cris/cris.c, config/iq2000/iq2000.c, config/mn10300/mn10300.c, config/ia64/ia64.c, config/m68k/m68k.c, config/rs6000/rs6000.c, config/picochip/picochip.c, config/darwin.c, config/arc/arc.c, config/mcore/mcore.c, config/score/score3.c, config/score/score7.c, config/score/score.c, config/arm/arm.c, config/pa/pa.c, config/mips/mips.c, config/vax/vax.c, config/h8300/h8300.c, config/v850/v850.c, config/mmix/mmix.c, config/bfin/bfin.c: Clean up redundant includes. * Makefile.in: Update accordingly. java/ChangeLog: * typeck.c, decl.c, jcf-parse.c, except.c, expr.c: cp/Changelog: * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c: Clean up redundant includes. fortran/ChangeLog: * trans-const.c, trans-types.c, trans-intrinsic.c: Clean up redundant includes. From-SVN: r159663
2010-05-13re PR bootstrap/44048 (building without C++ enabled fails)Jason Merrill1-7/+4
PR bootstrap/44048 PR target/44099 gcc/cp: * cp-tree.def (NULLPTR_TYPE): Remove. * cp-tree.h (NULLPTR_TYPE_P): New. (SCALAR_TYPE_P): Use it. (nullptr_type_node): New. (cp_tree_index): Add CPTI_NULLPTR_TYPE. * decl.c (cxx_init_decl_processing): Call record_builtin_type on nullptr_type_node. * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE. * cxx-pretty-print.c (pp_cxx_constant): Likewise. * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise. * mangle.c (write_type): Likewise. * name-lookup.c (arg_assoc_type): Likewise. * typeck.c (build_reinterpret_cast_1): Likewise. * rtti.c (typeinfo_in_lib_p): Likewise. (emit_support_tinfos): Remove local nullptr_type_node. gcc: * dbxout.c (dbxout_type): Remove NULLPTR_TYPE handling. * sdbout.c (plain_type_1): Likewise. * dwarf2out.c (is_base_type): Likewise. (gen_type_die_with_usage): Likewise. Generate DW_TAG_unspecified_type for any LANG_TYPE. From-SVN: r159350
2010-05-13cp-tree.h (UNKNOWN_TYPE): Remove.Jason Merrill1-4/+6
* cp-tree.h (UNKNOWN_TYPE): Remove. * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead. * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise. * typeck2.c (cxx_incomplete_type_diagnostic): Likewise. * class.c (instantiate_type): Check unknown_type_node rather than UNKNOWN_TYPE. * name-lookup.c (maybe_push_decl): Likewise. * rtti.c (get_tinfo_decl_dynamic): Likewise. (get_typeid): Likewise. * semantics.c (finish_offsetof): Likewise. From-SVN: r159349
2010-05-06Add support for C++0x nullptr.Jason Merrill1-0/+6
gcc: * c-common.c (c_common_reswords): Add nullptr. * c-common.h: Add RID_NULLPTR. Reorganize C++0x rids. * dwarf2out.c (is_base_type): Handle NULLPTR_TYPE. (gen_type_die_with_usage): Likewise. * dbxout.c (dbxout_type): Likewise. * sdbout.c (plain_type_1): Likewise. gcc/cp: * cp-tree.def: Add NULLPTR_TYPE. * cp-tree.h: Add nullptr_node. (cp_tree_index): Add CPTI_NULLPTR. (SCALAR_TYPE_P): Add NULLPTR_TYPE. * call.c (null_ptr_cst_p): Handle nullptr. (standard_conversion): Likewise. (convert_arg_to_ellipsis): Likewise. * mangle.c (write_type): Likewise. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_parser_primary_expression): Likewise. * typeck.c (cp_build_binary_op): Likewise. (build_reinterpret_cast_1): Likewise. * error.c (dump_type): Likewise. (dump_type_prefix, dump_type_suffix): Likewise. * decl.c (cxx_init_decl_processing): Likewise. * cxx-pretty-print.c (pp_cxx_constant): Likewise. * cvt.c (ocp_convert): Likewise. * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put nullptr_t tinfo in libsupc++. libstdc++-v3: * config/abi/pre/gnu.ver: Add typeinfo for decltype(nullptr). libiberty: * cp-demangle.c (cplus_demangle_builtin_types): Add nullptr. (cplus_demangle_type): Handle nullptr. From-SVN: r159131
2010-04-28re PR c++/9335 (repeated diagnostic when maximum template depth is exceeded)Manuel López-Ibáñez1-30/+59
2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c++/9335 cp/ * error.c (print_instantiation_partial_context_line): Handle recursive instantiation. (print_instantiation_partial_context): Likewise. testsuite/ * g++.dg/template/recurse2.C: Update * g++.dg/template/recurse.C: Update. * g++.dg/template/pr23510.C: Update. * lib/prune.exp: Filter out 'recursively instantiated'. From-SVN: r158823
2010-02-21re PR c++/23510 (skip some instantation contexts if there are too many)Manuel López-Ibáñez1-24/+77
2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c++/23510 cp/ * error.c (print_instantiation_partial_context_line): New. (print_instantiation_partial_context): Print at most 12 contexts, skip the rest with a message. testsuite/ * g++.dg/template/recurse.C: Adjust. * g++.dg/template/pr23510.C: New. From-SVN: r156942
2010-01-29Fix PRs c++/42758, c++/42634, c++/42797Dodji Seketeli1-43/+13
... and mitigate PR c++/42336 gcc/cp/ChangeLog: PR c++/42758 PR c++/42634 PR c++/42336 PR c++/42797 PR c++/42880 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT, SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT, GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros. * pt.c (coerce_template_parms, type_unification_real, expand_template_argument_pack, coerce_template_parameter_pack): Set the non default template args count. (current_template_args): Always set non defaulted template args count when compiled with --enable-checking (tsubst_template_args, type_unification_real): Propagate the non defaulted template args count. * error.c (get_non_default_template_args_count): Renamed count_non_default_template_args into this. Don't calculate the non default template argument count anymore. Use the new accessor macros above to get it. (dump_template_argument_list, dump_type, dump_decl, dump_template_parms): Adjust. * parser.c (cp_parser_template_argument_list): Always set defaulted template args count when compiled with --enable-checking. gcc/testsuite/ChangeLog: PR c++/42758 PR c++/42634 PR c++/42336 PR c++/42797 PR c++/42880 * g++.dg/other/crash-5.C: New test. * g++.dg/other/crash-6.C: New test. * g++.dg/other/crash-7.C: New test. * g++.dg/other/crash-8.C: New test. From-SVN: r156351
2010-01-19Revert fix of PR c++/Dodji Seketeli1-3/+4
gcc/cp/ChangeLog: * error.c (dump_template_parms, count_non_default_template_args): Revert fix of PR c++/42634. gcc/testsuite/ChangeLog: * g++.dg/template/error45.C: reverted as part of reverting the fix of PR c++/42634. From-SVN: r156026
2010-01-18re PR c++/42634 (ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973)Dodji Seketeli1-4/+3
Fix PR c++/42634 gcc/cp/ChangeLog: PR c++/42634 * error.c (dump_template_parms): Use innermost template arguments before calling count_non_default_template_args. (count_non_default_template_args): We are being called with template innermost arguments now. There is no need to ensure that again. gcc/testsuite/ChangeLog: PR c++/42634 * g++.dg/template/error45.C: New test. From-SVN: r156022
2010-01-15Revert commit of PR c++/42634, which was commit r155868Dodji Seketeli1-3/+4
From-SVN: r155936
2010-01-13re PR c++/42634 (ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973)Dodji Seketeli1-4/+3
Fix PR c++/42634 gcc/cp/ChangeLog: PR c++/42634 * error.c (dump_template_parms): Use innermost template arguments before calling count_non_default_template_args. (count_non_default_template_args): We are being called with template innermost arguments now. There is no need to ensure that again. gcc/testsuite/ChangeLog: PR c++/42634 * g++.dg/template/error45.C: New test. From-SVN: r155868