* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158810 138bc75d-0d04-0410-961f-82ee72b054a4
* semantics.c (finish_non_static_data_member): Call maybe_dummy_object whenever object is NULL_TREE. Don't do 'this' capture here. (finish_qualified_id_expr): Pass NULL_TREE. (finish_id_expression): Likewise. (lambda_expr_this_capture): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158809 138bc75d-0d04-0410-961f-82ee72b054a4
* semantics.c (finish_qualified_id_expr): Use maybe_dummy_object rather than checking current_class_ref directly. (finish_call_expr): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158808 138bc75d-0d04-0410-961f-82ee72b054a4
* semantics.c (baselink_for_fns): Correct BASELINK_BINFO. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158806 138bc75d-0d04-0410-961f-82ee72b054a4
PR c++/43641 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak return value directly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158241 138bc75d-0d04-0410-961f-82ee72b054a4
* semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node instead of void_zero_node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157926 138bc75d-0d04-0410-961f-82ee72b054a4
Make lambda conversion op and op() non-static. * semantics.c (maybe_add_lambda_conv_op): Make non-static. Also add the thunk function returned by the conversion op. Mark the conversion deleted if the op() is variadic. * decl2.c (mark_used): Give helpful message about deleted conversion. * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static. * semantics.c (finish_this_expr): Adjust. * mangle.c (write_closure_type_name): Adjust. * decl.c (grok_op_properties): Don't allow it. * call.c (build_user_type_conversion_1): No static conversion ops. (build_op_call): Or op(). * decl2.c (change_return_type): Fix 'this' quals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157681 138bc75d-0d04-0410-961f-82ee72b054a4
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159349 138bc75d-0d04-0410-961f-82ee72b054a4
PR c++/44062 * c-parser.c (c_parser_expression): Mark LHS of a comma expression as read if it is a decl, handled component or COMPOUND_EXPR with that on the RHS. * c-typeck.c (c_process_expr_stmt): Mark RHS of COMPOUND_EXPR if it is a decl or handled component. * semantics.c (finish_expr_stmt): Don't call mark_exp_read here... * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR, look at its second operand. * c-c++-common/Wunused-var-7.c: New test. * g++.dg/warn/Wunused-var-9.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159286 138bc75d-0d04-0410-961f-82ee72b054a4
PR c++/44017 * semantics.c (baselink_for_fns): Revert earlier change. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159246 138bc75d-0d04-0410-961f-82ee72b054a4
gcc: * gimplify.c (gimplify_expr): Set GS_ALL_DONE when appropriate. Don't change GS_OK to GS_ALL_DONE. Make sure that all cases set ret appropriately. (gimplify_compound_lval): Return GS_ALL_DONE as appropriate. gcc/cp: * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159125 138bc75d-0d04-0410-961f-82ee72b054a4
C++ support for -Wunused-but-set-variable 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159096 138bc75d-0d04-0410-961f-82ee72b054a4
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158810 138bc75d-0d04-0410-961f-82ee72b054a4
* semantics.c (finish_non_static_data_member): Call maybe_dummy_object whenever object is NULL_TREE. Don't do 'this' capture here. (finish_qualified_id_expr): Pass NULL_TREE. (finish_id_expression): Likewise. (lambda_expr_this_capture): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158809 138bc75d-0d04-0410-961f-82ee72b054a4
* semantics.c (finish_qualified_id_expr): Use maybe_dummy_object rather than checking current_class_ref directly. (finish_call_expr): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158808 138bc75d-0d04-0410-961f-82ee72b054a4
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158807 138bc75d-0d04-0410-961f-82ee72b054a4
* semantics.c (baselink_for_fns): Correct BASELINK_BINFO. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158806 138bc75d-0d04-0410-961f-82ee72b054a4
PR c++/43875 * semantics.c (lambda_return_type): Complain about braced-init-list. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158805 138bc75d-0d04-0410-961f-82ee72b054a4
PR c++/43641 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak return value directly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158241 138bc75d-0d04-0410-961f-82ee72b054a4
2010-04-12 Richard Guenther <rguenther@suse.de> PR c++/43611 * semantics.c (expand_or_defer_fn_1): Do not keep extern template inline functions. * g++.dg/torture/pr43611.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158218 138bc75d-0d04-0410-961f-82ee72b054a4