aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
AgeCommit message (Collapse)AuthorFilesLines
2011-02-03re PR c++/47398 (tree check: accessed elt 10 of tree_vec with 9 elts in ↵Dodji Seketeli1-0/+3
tsubst, at cp/pt.c:10500) Fix PR c++/47398 gcc/cp/ PR c++/47398 * tree.c (cp_tree_equal)<TEMPLATE_PARM_INDEX>: Take the number of template parameters in account. gcc/testsuite/ PR c++/47398 * g++.dg/template/typedef37.C: New test. * g++.dg/template/param1.C: Adjust expected error message. From-SVN: r169807
2011-01-21re PR c++/46977 ([C++0x] ICE: SIGSEGV in htab_find_slot_with_hash ↵Jason Merrill1-3/+7
(hashtab.c:650)) PR c++/46977 * semantics.c (potential_constant_expression_1): Split out from potential_constant_expression. Add want_rval parm. Handle template expression forms. Don't enforce restriction on address of automatic variable here. Add a couple of diagnostics that had been missing. (require_potential_constant_expression): New entry point. (build_data_member_initialization, register_constexpr_fundef): Adjust. (maybe_constant_value): Check potential_constant_expression. * pt.c (fold_non_dependent_expr_sfinae): Likewise. * tree.c (build_vec_init_expr): Adjust. From-SVN: r169096
2011-01-14re PR c++/46688 (g++ requires a function declaration when it should not)Jason Merrill1-1/+6
PR c++/46688 * tree.c (build_vec_init_expr): Handle flexible array properly. From-SVN: r168782
2011-01-11re PR c++/45520 ([C++0x] compiler segmentation fault on decltype in ↵Jason Merrill1-6/+6
lambda-declarator) PR c++/45520 * tree.c (maybe_dummy_object): Check current_class_ref against context, not current_class_type. From-SVN: r168654
2011-01-01ChangeLog gcc/Kai Tietz1-1/+2
2011-01-01 Kai Tietz <kai.tietz@onevision.com> PR target/38662 * tree.c (type_hash_eq): Call language hook for METHOD_TYPEs, too. ChangeLog gcc/cp 2011-01-01 Kai Tietz <kai.tietz@onevision.com> PR target/38662 * tree.c (cxx_type_hash_eq): Allow METHOD_TYPE, too. ChangeLog gcc/testsuite 2011-01-01 Kai Tietz <kai.tietz@onevision.com> PR target/38662 * g++.dg/eh/pr38662.C: New testcase. From-SVN: r168389
2010-12-22re PR c++/47003 (ice in stabilize_expr)Jason Merrill1-3/+1
PR c++/47003 * tree.c (stabilize_expr): Really stabilize scalar glvalues. From-SVN: r168180
2010-12-03re PR c++/46058 (gcc crashes with lvalue error on the following Code)Jason Merrill1-2/+5
PR c++/46058 * tree.c (lvalue_kind) [SCOPE_REF]: Handle non-dependent case. From-SVN: r167435
2010-11-30diagnostic-core.h: Include bversion.h.Joseph Myers1-2/+1
* 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-09re PR c++/45894 ([C++0x] ICE: segmentation fault with -Wall)Jakub Jelinek1-1/+2
PR c++/45894 * tree.c (lvalue_kind): Don't crash if ref has NULL type. * g++.dg/warn/Wsequence-point-2.C: New test. From-SVN: r166481
2010-11-08re PR c++/46335 ([C++0X] [4.6 Regression] ICE: in gimple_add_tmp_var, at ↵Jason Merrill1-3/+2
gimplify.c:701) PR c++/46335 * tree.c (bot_manip): Check TREE_SIDE_EFFECTS as well. From-SVN: r166470
2010-11-06init.c (perform_member_init): Use build_vec_init_expr for value-init of ↵Jason Merrill1-15/+35
arrays, too. * init.c (perform_member_init): Use build_vec_init_expr for value-init of arrays, too. * cp-gimplify.c (cp_gimplify_expr): Use VEC_INIT_EXPR_VALUE_INIT. * cp-tree.h (VEC_INIT_EXPR_IS_CONSTEXPR): New macro. (VEC_INIT_EXPR_VALUE_INIT): New macro. * semantics.c (potential_constant_expression): No longer static. Check VEC_INIT_EXPR_IS_CONSTEXPR. * tree.c (build_vec_init_expr): Handle value-init. Set VEC_INIT_EXPR_IS_CONSTEXPR and VEC_INIT_EXPR_VALUE_INIT. From-SVN: r166413
2010-11-02Restore canonical type comparison for dependent type(def)sDodji Seketeli1-16/+0
This patch restores canonical type comparison for dependent types and then dependent typedefs. After this patch, two template type parameters T are equal if they have the same index, level, *and* number of sibling parameters. The novelty is to take in account the number of sibling parameters. To do this we first build the template parameters w/o taking in account their number of siblings. When we know the number of template parameters we fix up each template parameter with the number of slibling parameters and we build the appropriate canonical types accordingly. The patch fixes the fallouts deemed necessary. This fixes PR c++/45606 but actually fixes all the previous bugs related to dependent typedef comparison we had since we started to properly representing dependent typedefs. gcc/cp/ChangeLog: PR c++/45606 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove. (struct template_parm_index_s)<num_siblings>: New field. (TEMPLATE_PARM_NUM_SIBLINGS): New accessor. (process_template_parm): Extend the API to accept the number of template parms in argument. (cp_set_underlying_type): Remove this. * class.c (build_self_reference): Require canonical type equality back on the self reference of class. * decl2.c (grokfield): Require canonical type equality back on typedef class fields. * name-lookup.c (pushdecl_maybe_friend): Require canonical type equality back on typedefs. * parser.c (cp_parser_template_parameter_list): Do not require canonical type equality on dependent types created during template parameters parsing. * pt.c (fixup_template_type_parm_type, fixup_template_parm_index) (fixup_template_parm, fixup_template_parms): New private functions. (current_template_args): Declare this. (process_template_parm): Pass the total number of template parms to canonical_type_parameter. (build_template_parm_index): Add a new argument to carry the total number of template parms. (reduce_template_parm_level, process_template_parm, make_auto): Adjust. (current_template_args): Fix this for template template parameters. (tsubst_template_parm): Split out of ... (tsubst_template_parms): ... this. (reduce_template_parm_level): Don't loose TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX. (template_parm_to_arg): Extracted this function from current_template_args. Make it represent invalid template parms with an error_mark_node instead of a LIST_TREE containing an error_mark_node. (current_template_args): Use template_parm_to_arg. (dependent_template_arg_p): Consider an invalid template argument as dependent. (end_template_parm_list): Do not update template sibling parms here anymore. Use fixup_template_parms instead. (process_template_parm): Pass the number of template parms to canonical_type_parameter. (make_auto): Require structural equality on auto TEMPLATE_TYPE_PARM for now. (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters using all the arguments deduced so far. (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to canonical_type_parameter. * tree.c (cp_set_underlying_type): Remove. * typeck.c (get_template_parms_of_dependent_type) (incompatible_dependent_types_p): Remove. (structural_comptypes): Do not call incompatible_dependent_types_p anymore. (comp_template_parms_position): Re-organized. Take the length of template parms list in account. gcc/testsuite/ChangeLog: PR c++/45606 * g++.dg/template/typedef36.C: New test. * gcc/testsuite/g++.dg/template/canon-type-9.C: Likewise. * g++.dg/template/canon-type-10.C: Likewise. * g++.dg/template/canon-type-11.C: Likewise. * g++.dg/template/canon-type-12.C: Likewise. * g++.dg/template/canon-type-13.C: Likewise. From-SVN: r166179
2010-11-01call.c (null_ptr_cst_p): Use maybe_constant_value.Jason Merrill1-0/+1
* call.c (null_ptr_cst_p): Use maybe_constant_value. (set_up_extended_ref_temp): Support constant initialization. (initialize_reference): Adjust. * class.c (check_bitfield_decl): Use cxx_constant_value. * cvt.c (ocp_convert): Don't use integral_constant_value when converting to class type. * decl.c (finish_case_label): Use maybe_constant_value. (build_init_list_var_init): Support constant initialization. (check_initializer): Likewise. Reorganize. (cp_finish_decl): Likewise. (expand_static_init): Likewise. (compute_array_index_type): Use maybe_constant_value. Add complain parm. (create_array_type_for_decl, grokdeclarator): Pass it. (build_enumerator): Use cxx_constant_value. * decl2.c (grokfield): Use maybe_constant_init. * except.c (check_noexcept_r): Handle constexpr. (build_noexcept_spec): Use maybe_constant_value. * init.c (expand_default_init): Support constant initialization. (build_vec_init): Likewise. (constant_value_1): Adjust. (build_new_1): Adjust. * parser.c (cp_parser_constant_expression): Allow non-integral in C++0x mode. (cp_parser_direct_declarator): Don't fold yet in C++0x mode. (cp_parser_initializer_clause): Toss folded result if non-constant. * pt.c (fold_decl_constant_value): Remove. (convert_nontype_argument): Use maybe_constant_value. Give clearer error about overflow. (tsubst): Move array bounds handling into compute_array_index_type. (value_dependent_expression_p): Handle constant CALL_EXPR. * semantics.c (finish_static_assert): Use maybe_constant_value. (ensure_literal_type_for_constexpr_object): Make sure type is complete. (potential_constant_expression): Use maybe_constant_value. * tree.c (cast_valid_in_integral_constant_expression_p): Any cast is potentially valid in C++0x. * typeck2.c (store_init_value): Handle constant init. (check_narrowing): Use maybe_constant_value. (build_functional_cast): Set TREE_CONSTANT on literal T(). * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove. (LOOKUP_ALREADY_DIGESTED): New. (compute_array_index_type): Adjust prototype. From-SVN: r166167
2010-10-27* tree.c (build_cplus_new): Handle CONSTRUCTOR.Jason Merrill1-1/+2
From-SVN: r166007
2010-10-26tree.c (build_vec_init_expr): Split out from...Jason Merrill1-5/+38
* tree.c (build_vec_init_expr): Split out from... (build_array_copy): ...here. * init.c (perform_member_init): Use it. * cp-tree.h: Declare it. * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters. (cp_gimplify_expr): Handle array default-initialization via VEC_INIT_EXPR. From-SVN: r165976
2010-10-26* tree.c (stabilize_expr): Handle xvalues properly.Jason Merrill1-2/+7
From-SVN: r165969
2010-10-24In gcc/cp/: 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-9/+0
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-23In gcc/cp/: 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-0/+9
In gcc/cp/: 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com> * tree.c (cxx_printable_name_internal): In Objective-C++, call objc_maybe_printable_name. In gcc/objc/: 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c (OBJC_GEN_METHOD_LABEL): Updated comments. (objc_demangle): Return NULL if demangling can not be done because the string to demangle is not an Objective-C mangled method name. Be smarter in demangling method names so that at least for methods with no arguments we are able to almost always demangle '_' correctly. Updated comments. (objc_maybe_printable_name): New. (objc_printable_name): Call objc_maybe_printable_name. If it returns NULL, call cxx_printable_name in Objective-C++. In gcc/testsuite/: 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/demangle-1.m: New test. * obj-c++.dg/demangle-1.mm: New test. * obj-c++.dg/demangle-2.mm: New test. * obj-c++.dg/demangle-3.mm: New test. In gcc/c-family/: 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com> * c-common.h (objc_maybe_printable_name): New. * stub-objc.c (objc_maybe_printable_name): New. From-SVN: r165887
2010-10-15re PR c++/45983 (ICE: tree code 'template_parm_index' is not supported in ↵Jason Merrill1-1/+1
gimple streams with -lto) PR c++/45983 * tree.c (cp_build_qualified_type_real): Don't reuse a variant with a different typedef variant of the element type. From-SVN: r165521
2010-10-13tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and clear DECL_CHAIN ↵Richard Guenther1-0/+9
of NAMESPACE_DECLs. 2010-10-12 Richard Guenther <rguenther@suse.de> * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and clear DECL_CHAIN of NAMESPACE_DECLs. From-SVN: r165413
2010-10-04tree.c (decl_storage_duration): New.Jason Merrill1-0/+19
* tree.c (decl_storage_duration): New. * cp-tree.h: Declare it. (duration_kind): Return values. From-SVN: r164944
2010-09-28tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.Jason Merrill1-16/+15
* tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic. (real_lvalue_p): Take const_tree. * cp-tree.h: Adjust. * typeck.c (lvalue_or_else): Make temporary arg a permerror. (cp_build_addr_expr_1): Likewise. From-SVN: r164704
2010-09-27Require lvalues as specified by the standard.Jason Merrill1-1/+1
* typeck.c (lvalue_or_else): Use real_lvalue_p. (cp_build_addr_expr_1): Split out of cp_build_unary_op. (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces. (decay_conversion, get_member_function_from_ptrfunc): Adjust. (build_x_unary_op, build_reinterpret_cast_1): Adjust. (build_const_cast_1): Adjust. * cp-tree.h: Declare new fns. * call.c (build_this, convert_like_real, build_over_call): Adjust. (initialize_reference): Adjust. * class.c (build_base_path, convert_to_base_statically): Adjust. (build_vfn_ref, resolve_address_of_overloaded_function): Adjust. * cvt.c (build_up_reference, convert_to_reference): Adjust. * decl.c (register_dtor_fn): Adjust. * decl2.c (build_offset_ref_call_from_tree): Adjust. * except.c (initialize_handler_parm): Adjust. * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust. * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust. * tree.c (stabilize_expr): Adjust. From-SVN: r164666
2010-09-06Patch PR c++/45200Dodji Seketeli1-0/+5
Fix PR c++/45200, c++/45293, c++/45558 gcc/cp/Changelog: PR c++/45200 PR c++/45293 PR c++/45558 * tree.c (strip_typedefs): Strip typedefs from the context of TYPENAME_TYPEs. gcc/testsuite/ChangeLog: PR c++/45200 PR c++/45293 PR c++/45558 * g++.dg/template/typedef34.C: New test. * g++.dg/template/typedef35.C: New test. From-SVN: r163929
2010-08-09builtins.c (fold_builtin_next_arg): Use stdarg_p.Nathan Froyd1-5/+1
gcc/ * builtins.c (fold_builtin_next_arg): Use stdarg_p. * config/arm/arm.c (arm_get_pcs_model): Likewise. * config/avr/avr.c (init_cumulative_args): Likewise. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m68k/m68k.c (m68k_return_pops_args): Likewise. * config/mn10300/mn10300.c (mn10300_builtin_saveregs): Likewise. * config/pa/pa.c (hppa_builtin_saveregs): Likewise. * config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Likewise. * config/rs6000/rs6000.c (init_cumulative_args): Likewise. * dwarf2out.c (gen_subprogram_die): Likewise. * function.c (allocate_struct_function): Likewise. * c-aux-info.c (gen_formal_list_for_func_dec): Likewise. (deserves_ellipsis): Delete. gcc/cp/ * tree.c (varargs_function_p): Use stdarg_p. From-SVN: r163033
2010-08-06typeck.c (complete_type_or_maybe_complain): Split out from...Jason Merrill1-1/+2
* typeck.c (complete_type_or_maybe_complain): Split out from... (complete_type_or_else): Here. (build_class_member_access_expr): Call it. (finish_class_member_access_expr): Likewise. * call.c (build_special_member_call): Likewise. * cvt.c (build_expr_type_conversion): Likewise. * init.c (build_new): Likewise. * typeck2.c (build_functional_cast): Likewise. * cp-tree.h: Declare it. * init.c (build_value_init): Add complain parm. (build_value_init_noctor): Likewise. (perform_member_init): Pass it. (expand_aggr_init_1): Likewise. (build_new_1): Likewise. (build_vec_init): Likewise. * pt.c (tsubst_expr): Likewise. * typeck2.c (build_functional_cast): Likewise. * cp-tree.h: Adjust. * tree.c (build_target_expr_with_type): Handle error_mark_node. From-SVN: r162953
2010-07-21* tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.Jason Merrill1-4/+14
From-SVN: r162378
2010-07-19re PR c++/44969 ([C++0x] <type_traits> std::is_constructible broken for ↵Jason Merrill1-0/+11
fundamental types.) PR c++/44969 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR. * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR. From-SVN: r162307
2010-06-30tree.h (block_may_fallthru): Declare here.Manuel López-Ibáñez1-1/+1
2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org> * tree.h (block_may_fallthru): Declare here. * tree-flow.h (block_may_fallthru): Do not declare here. * c-typeck.c: Do not include tree-flow.h. Include gimple.h and bitmap.h * Makefile.in (c-typeck.o): Update dependencies. c-family/ * c-gimplify.c: Do not include tree-flow.h cp/ * tree.c: Include gimple.h. Do not include tree-flow.h * decl.c: Do not include tree-flow.h * Make-lang.in: Adjust dependencies. ada/ * gcc-interface/trans.c: Do not include tree-flow.h. * gcc-interface/Make-lang.in: Adjust dependencies. From-SVN: r161591
2010-06-29Enable implicitly declared move constructor/operator= (N3053).Jason Merrill1-6/+18
gcc/cp/ * class.c (add_implicitly_declared_members): A class with no explicitly declared copy or move constructor gets both declared implicitly, and similarly for operator=. (check_bases): A type with no copy ctor does not inhibit a const copy ctor in a derived class. (check_field_decl): Likewise. (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial. * tree.c (type_has_nontrivial_copy_init): Adjust semantics. (trivially_copyable_p): Likewise. * call.c (convert_like_real): Use type_has_nontrivial_copy_init. * class.c (finish_struct_bits): Likewise. * tree.c (build_target_expr_with_type): Likewise. * typeck2.c (store_init_value): Likewise. libstdc++-v3/ * include/bits/unordered_map.h: Explicitly default copy constructors. * include/bits/unordered_set.h: Likewise. From-SVN: r161582
2010-06-29Machinery to support implicit delete/move.Jason Merrill1-1/+6
* cp-tree.h: (struct lang_type_class): Add lazy_move_assign, has_complex_move_ctor, has_complex_move_assign bitfields. (CLASSTYPE_LAZY_MOVE_ASSIGN): New. (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New. (TYPE_HAS_COMPLEX_MOVE_CTOR): New. (enum special_function_kind): Add sfk_move_assignment. (LOOKUP_SPECULATIVE): New. * call.c (build_over_call): Return early if it's set. (build_over_call): Use trivial_fn_p. * class.c (check_bases): If the base has no default constructor, the derived one is non-trivial. Handle move ctor/op=. (check_field_decl): Likewise. (check_bases_and_members): Handle move ctor/op=. (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN. (type_has_move_constructor, type_has_move_assign): New. * decl.c (grok_special_member_properties): Handle move ctor/op=. * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New. (trivial_fn_p): New. (do_build_copy_constructor): Use it. (do_build_assign_ref): Likewise. Handle move assignment. (build_stub_type, build_stub_object, locate_fn_flags): New. (locate_ctor): Use locate_fn_flags. (locate_copy, locate_dtor): Remove. (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New. (process_subob_fn, synthesized_method_walk): New. (maybe_explain_implicit_delete): New. (implicitly_declare_fn): Use synthesized_method_walk, type_has_trivial_fn, and type_set_nontrivial_flag. (defaulted_late_check): Set DECL_DELETED_FN. (defaultable_fn_check): Handle sfk_move_assignment. (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare implicitly deleted move ctor/op=. * search.c (lookup_fnfields_1): Handle sfk_move_assignment. (lookup_fnfields_slot): New. * semantics.c (omp_clause_info_fndecl): Remove. (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor, get_copy_assign, trivial_fn_p. (trait_expr_value): Adjust call to locate_ctor. * tree.c (special_function_p): Handle sfk_move_assignment. From-SVN: r161579
2010-06-29class.c (type_has_virtual_destructor): New.Jason Merrill1-4/+19
* class.c (type_has_virtual_destructor): New. * cp-tree.h: Declare it. * semantics.c (trait_expr_value): Use it. * call.c (build_over_call): Only give warnings with tf_warning. * name-lookup.c (pop_scope): Handle NULL_TREE. From-SVN: r161578
2010-06-29cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.Jason Merrill1-5/+5
* cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN. (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN. (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR. (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR. (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN. (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR. (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN. (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR. (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN. (sfk_assignment_operator): Rename to sfk_copy_assignment. * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust. * search.c, semantics.c, tree.c: Adjust. From-SVN: r161577
2010-06-06re PR c++/44188 (Fails to produce DW_AT_typedef for typedef of anonymous struct)Dodji Seketeli1-8/+0
Fix PR c++/44188 gcc/ChangeLog: PR c++/44188 * c-common.c (is_typedef_decl): Move this definition ... * tree.c (is_typedef_decl): ... here. (typdef_variant_p): Move definition here from gcc/cp/tree.c. * c-common.h (is_typedef_decl): Move this declaration ... * tree.h (is_typedef_decl): ... here. (typedef_variant_p): Move declaration here from gcc/cp/cp-tree.h * dwarf2out.c (is_naming_typedef_decl): New function. (gen_tagged_type_die): Split out of ... (gen_type_die_with_usage): ... this function. When an anonymous tagged type is named by a typedef, make sure a DW_TAG_typedef DIE is emitted for the typedef. (gen_typedef_die): Emit DW_TAG_typedef also for typedefs naming anonymous tagged types. gcc/cp/ChangeLog: PR c++/44188 * cp-tree.h (typedef_variant_p): Move this declaration to gcc/tree.h. * tree.c (typedef_variant_p): Move this definition to gcc/tree.c. * decl.c (grokdeclarator): Do not rename debug info of an anonymous tagged type named by a typedef. gcc/testsuite/ChangeLog: PR c++/44188 * g++.dg/debug/dwarf2/typedef3.C: New test. From-SVN: r160347
2010-06-04Implement noexcept-specification (15.4)Jason Merrill1-9/+11
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-04call.c (build_conditional_expr): Never fold in unevaluated context.Jason Merrill1-0/+1
* call.c (build_conditional_expr): Never fold in unevaluated context. * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW. * semantics.c (simplify_aggr_init_expr): Likewise. * typeck.c (merge_types): Call merge_exception_specifiers. * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than DECL_ANTICIPATED for preferring new type. From-SVN: r160296
2010-05-28c-common.h: Add FIXME for awkward split of c_register_addr_space.Steven Bosscher1-0/+10
gcc/ChangeLog: * c-common.h: Add FIXME for awkward split of c_register_addr_space. * c-common.c (c_register_addr_space): Remove here. * c-decl.c (c_register_addr_space): Re-add here. cp/ChangeLog: * tree.c (c_register_addr_space): Add stub. From-SVN: r160006
2010-05-28Revert "Fix PR c++/44188"Dodji Seketeli1-0/+8
gcc/ChangeLog: revert fix for PR c++/44188 * c-common.c (is_typedef_decl): Revert the moving of this definition ... * tree.c (is_typedef_decl): ... here. (typdef_variant_p): Revert the moving of this definition here from gcc/cp/tree.c. * c-common.h (is_typedef_decl): Revert the moving of this declaration ... * tree.h (is_typedef_decl): ... here. (typedef_variant_p): Revert the moving of this declaration here from gcc/cp/cp-tree.h * dwarf2out.c (is_naming_typedef_decl): Revert this new function. (gen_tagged_type_die): Revert the splitting out of ... (gen_type_die_with_usage): ... this function. Revert the anonymous tagged type handling. (gen_typedef_die): Revert emitting DW_TAG_typedef for typedefs naming anonymous tagged types. gcc/cp/ChangeLog: Revert fix of PR c++/44188 * cp-tree.h (typedef_variant_p): Revert moving this declaration to gcc/tree.h. * tree.c (typedef_variant_p): Revert moving this definition to gcc/tree.c. * decl.c (grokdeclarator): Revert naming typedef handling. gcc/testsuite/ChangeLog: Revert fix for PR c++/44188 * g++.dg/debug/dwarf2/typedef3.C: Revert new test. From-SVN: r159955
2010-05-27re PR c++/44188 (Fails to produce DW_AT_typedef for typedef of anonymous struct)Dodji Seketeli1-8/+0
Fix PR c++/44188 gcc/ChangeLog: PR c++/44188 * c-common.c (is_typedef_decl): Move this definition ... * tree.c (is_typedef_decl): ... here. (typdef_variant_p): Move definition here from gcc/cp/tree.c. * c-common.h (is_typedef_decl): Move this declaration ... * tree.h (is_typedef_decl): ... here. (typedef_variant_p): Move declaration here from gcc/cp/cp-tree.h * dwarf2out.c (is_naming_typedef_decl): New function. (gen_tagged_type_die): Split out of ... (gen_type_die_with_usage): ... this function. When an anonymous tagged type is named by a typedef, make sure a DW_TAG_typedef DIE is emitted for the typedef. (gen_typedef_die): Emit DW_TAG_typedef also for typedefs naming anonymous tagged types. gcc/cp/ChangeLog: PR c++/44188 * cp-tree.h (typedef_variant_p): Move this declaration to gcc/tree.h. * tree.c (typedef_variant_p): Move this definition to gcc/tree.c. * decl.c (grokdeclarator): Do not rename debug info of an anonymous tagged type named by a typedef. gcc/testsuite/ChangeLog: PR c++/44188 * g++.dg/debug/dwarf2/typedef3.C: New test. From-SVN: r159943
2010-05-25Makefile.in (EXCEPT_H): Fix typo.Steven Bosscher1-4/+1
gcc/ChangeLog: * Makefile.in (EXCEPT_H): Fix typo. objc/ChangeLog: * objc-act.h: Do not include gimple.h. * objc-act.c: Do not include rtl.h, expr.h, libfuncs.h, and tm_p.h. Include gimple.h. Explain why except.h has to be included. * objc-lang.c: Do not include diagnostics.h. * Make-lang.in: Update dependencies. objcp/ChangeLog: * objcp-decl.c: Do not include tm.h, rtl.h, expr.h, c-common.h, flags.h, input.h, except.h, output.h, toplev.h, cpplib.h, debug.h, and target.h. * objcp-lang.c: Do not include tm.h, toplev.h, diagnostics.h, and debug.h. Explain why except.h has to be included. * Make-lang.in: Update dependencies. cp/ChangeLog: * cp-tree.h: Do not include splay-tree.h. (struct prtmem_cst): Remove unused field and false comment. * typeck.c: Do not include rtl.h, expr.h, and tm_p.h. * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h. * init.c: Do not include rtl.h and expr.h. * class.c: Do not include rtl.h. Include splay-tree.h. (build_clone): Use plain NULL instead of NULL_RTX. * decl.c: Do not include expr.h. Explain why rtl.h has to be included. Include splay-tree.h. * method.c: Do not include rtl.h and expr.h. (use_thunk): Use plain NULL instead of NULL_RTX. * except.c: Do not include rtl.h, expr.h, and libfuncs.h. * tree.c: Do not include rtl.h, insn-config.h, integrate.h, and target.h. Include splay-tree.h. * expr.c: Do not include rtl.h and expr.h. * pt.c: Do not include obstack.h and rtl.h. (tsubst_friend_function): Use plain NULL instead of NULL_RTX. (tsubst_decl): Likewise. (instantiate_decl): Likewise. * semantics.c: Do not include exprt.h and debug.h. Explain why rtl.h has to be included. * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h. * call.c: Do not include rtl.h and expr.h. * search.c: Do not include obstack.h and rtl.h. * friend.c: Do not include rtl.h and expr.h. * Make-lang.in: Update dependencies. From-SVN: r159839
2010-05-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-19call.c (reference_binding): Use cp_build_qualified_type_real and ↵Jason Merrill1-1/+1
cp_type_quals consistently. * call.c (reference_binding): Use cp_build_qualified_type_real and cp_type_quals consistently. (add_function_candidate): Likewise. (build_conditional_expr): Likewise. (convert_like_real): Likewise. (type_passed_as): Likewise. * class.c (add_method): Likewise. (same_signature_p): Likewise. (layout_class_type): Likewise. * decl.c (cxx_init_decl_processing): Likewise. (cp_fname_init): Likewise. (grokdeclarator): Likewise. * decl2.c (cp_reconstruct_complex_type): Likewise. * init.c (build_new_1): Likewise. * method.c (do_build_copy_constructor): Likewise. (implicitly_declare_fn): Likewise. * pt.c (tsubst_aggr_type): Likewise. (tsubst): Likewise. * rtti.c (init_rtti_processing): Likewise. (build_headof): Likewise. (build_dynamic_cast_1): Likewise. (tinfo_base_init): Likewise. (emit_support_tinfos): Likewise. * semantics.c (capture_decltype): Likewise. * tree.c (cv_unqualified): Likewise. * typeck.c (composite_pointer_type): Likewise. (string_conv_p): Likewise. * mangle.c (write_CV_qualifiers_for_type): Tweak. * call.c (initialize_reference): Use CP_TYPE_CONST_P. * decl.c (start_decl): Likewise. * semantics.c (finish_compound_literal): Likewise. * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P. (cp_type_readonly): Remove. * cp-tree.h: Remove declaration. From-SVN: r159599
2010-05-19decl.c (grokdeclarator): Don't check quals on fn type.Jason Merrill1-16/+10
* decl.c (grokdeclarator): Don't check quals on fn type. * typeck.c (cp_apply_type_quals_to_decl): Likewise. * tree.c (cp_build_qualified_type_real): Simplify qualifier checking. From-SVN: r159597
2010-05-19re PR c++/44193 (function types, cv-quals and typename)Jason Merrill1-0/+8
PR c++/44193 * typeck.c (type_memfn_quals): New fn. (apply_memfn_quals): New fn. (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE. (cp_type_readonly): Use cp_type_quals. * cp-tree.h: Add declarations. * tree.c (cp_build_qualified_type_real): Don't set, but do preserve, quals on FUNCTION_TYPE. (strip_typedefs): Use apply_memfn_quals and type_memfn_quals. * decl.c (build_ptrmem_type): Likewise. (grokdeclarator): Likewise. (static_fn_type): Likewise. * decl2.c (change_return_type): Likewise. (cp_reconstruct_complex_type): Likewise. * pt.c (tsubst_function_type): Likewise. (unify): Likewise. (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code. From-SVN: r159596
2010-05-18tree.h (build_call_list): Remove.Nathan Froyd1-3/+3
gcc/ * tree.h (build_call_list): Remove. * tree.c (build_call_list): Remove. gcc/ada/ * gcc-interface/trans.c (call_to_gnu): Use build_call_vec instead of build_call_list. * gcc-interface/utils.c (build_function_stub): Likewise. gcc/cp/ * tree.c (build_min_non_dep_call_vec): Update comment. gcc/java/ * expr.c (expand_java_multianewarray): Use build_call_vec instead of build_call_list. (pop_arguments): Return a VEC instead of a tree. Take a method type rather than a list of argument types. (rewrite_rule): Change signature. of rewrite_arglist member. (rewrite_arglist_getcaller): Update signature. (rewrite_arglist_getclass): Likewise. (maybe_rewrite_invocation): Update for rewrite_arglist change. (build_known_method_ref): Take a VEC instead of a tree. (invoke_build_dtable): Likewise. (expand_invoke): Update calls to pop_arguments. Use build_call_vec instead of build_call_list. (build_jni_stub): Use build_call_vec instead of build_call_list. * java-tree.h (maybe_rewrite_invocation): Update declaration. (build_known_method_ref): Likewise. (invoke_build_dtable): Likewise. From-SVN: r159548
2010-05-06C++ support for -Wunused-but-set-variableJakub Jelinek1-0/+2
gcc/cp/ChangeLog: PR 18624 * cp-tree.h (mark_exp_read, mark_rvalue_use, mark_lvalue_use, mark_type_use): Declare ... * expr.c (mark_exp_read, mark_rvalue_use, mark_lvalue_use, mark_type_use): ... new fns. * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call mark_type_use. (perform_integral_promotions): Call mark_rvalue_use. (cp_build_unary_op): Call mark_lvalue_use. (decay_conversion): Update comment. Call mark_lvalue. * decl.c (unused_but_set_errorcount): New variable. (poplevel): Issue -Wunused-but-set-variable diagnostics. (duplicate_decls): Merge DECL_READ_P flags. (start_cleanup_fn): Set DECL_READ_P flag. (finish_function): Issue -Wunused-but-set-parameter diagnostics. * tree.c (rvalue): Call mark_rvalue_use. * pt.c (convert_nontype_argument): Likewise. * semantics.c (finish_typeof, finish_decltype_type): Call mark_type_use. (finish_asm_stmt): Call mark_lvalue_use. (finish_expr_stmt): Call mark_exp_read. * call.c (convert_like_real) <ck_identity, ck_user>: Call mark_rvalue_use. (build_x_va_arg): Call mark_lvalue_use. (build_over_call): Call mark_type_use. * init.c (build_new, build_delete): Call mark_value_use. * rtti.c (build_typeid): Call mark_lvalue_use or mark_type_use. (build_dynamic_cast_1): call mark_lvalue_use or mark_rvalue_use. gcc/testsuite/ChangeLog: PR 18624 * g++.dg/warn/Wunused-7.C: Add dg-warning. * g++.dg/template/sfinae16.C: Likewise. * gcc.dg/Wunused-var-1.c: Moved to... * c-c++-common/Wunused-var-1.c: ...here. New test. * gcc.dg/Wunused-var-2.c: Moved to... * c-c++-common/Wunused-var-2.c: ...here. New test. * gcc.dg/Wunused-var-3.c: Moved to... * c-c++-common/Wunused-var-3.c: ...here. New test. * gcc.dg/Wunused-var-4.c: Moved to... * gcc.dg/Wunused-var-1.c: ... here. * gcc.dg/Wunused-var-5.c: Moved to... * c-c++-common/Wunused-var-4.c: ...here. New test. * gcc.dg/Wunused-var-7.c: Moved to... * c-c++-common/Wunused-var-5.c: ...here. New test. * gcc.dg/Wunused-var-6.c: Moved to... * gcc.dg/Wunused-var-2.c: ... here. * c-c++-common/Wunused-var-1.c: New test. * c-c++-common/Wunused-var-2.c: New test. * c-c++-common/Wunused-var-3.c: New test. * c-c++-common/Wunused-var-4.c: New test. * c-c++-common/Wunused-var-5.c: New test. * g++.dg/warn/Wunused-var-1.C: New test. * g++.dg/warn/Wunused-var-2.C: New test. * g++.dg/warn/Wunused-var-3.C: New test. * g++.dg/warn/Wunused-var-4.C: New test. * g++.dg/warn/Wunused-var-5.C: New test. * g++.dg/warn/Wunused-var-6.C: New test. * g++.dg/warn/Wunused-var-7.C: New test. * g++.dg/warn/Wunused-var-8.C: New test. * g++.dg/warn/Wunused-parm-1.C: New test. * g++.dg/warn/Wunused-parm-2.C: New test. * g++.dg/warn/Wunused-parm-3.C: New test. Co-Authored-By: Dodji Seketeli <dodji@redhat.com> From-SVN: r159096
2010-04-27tree.c (get_fns): Split out from get_first_fn.Jason Merrill1-2/+8
* tree.c (get_fns): Split out from get_first_fn. * cp-tree.h: Declare it. * search.c (shared_member_p): Use it. * semantics.c (finish_qualified_id_expr): Simplify. (finish_id_expression): Simplify. From-SVN: r158810
2010-04-27re PR c++/43856 ([C++0x] gcc-4.5.0 fails to transform id-expression into ↵Jason Merrill1-4/+11
class member access in lambda compound-statement) PR c++/43856 * name-lookup.c (qualify_lookup): Disqualify lambda op(). * class.c (current_nonlambda_class_type): New fn. * semantics.c (nonlambda_method_basetype): New. * cp-tree.h: Declare them. * tree.c (maybe_dummy_object): Handle implicit 'this' capture. From-SVN: r158807
2010-04-27re PR c++/43790 ([C++0x] In lambda express, calling member function of ↵Jason Merrill1-1/+6
non-captured class gives internal compiler error) PR c++/43790 * tree.c (cv_unqualified): Handle error_mark_node. From-SVN: r158801
2010-04-07pt.c (print_template_statistics): New.Jason Merrill1-0/+1
* pt.c (print_template_statistics): New. * cp-tree.h: Declare it. * tree.c (cxx_print_statistics): Call it. From-SVN: r158072