aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
AgeCommit message (Collapse)AuthorFilesLines
2003-12-25PR c++/13268, c++/13339Andrew Pinski1-0/+3
PR c++/13268, c++/13339 * class.c (add_method): Return early when method is error_mark_node. * pt.c (tsubst_friend_function): Return early when new_friend is error_mark_node. From-SVN: r75022
2003-12-22re PR c++/12862 (Conflicts Between typedefs/enums and Namespace Member ↵Mark Mitchell1-58/+2
Declarations) * c-common.c (flag_external_templates): Remove. (flag_alt_external_templates): Likewise. * c-common.h (flag_external_templates): Remove. (flag_alt_external_templates): Likewise. * c-opts.c (c_common_handle_option): Unsupport -falt-external-templates and -ftemplates. * doc/invoke.texi: Remove mention of -fexternal-templates and -falt-external-templates. * decl.c (start_function): Do not check flag_alt_external_templates or flag_external_templates. * decl2.c (warn_if_unknown_interface): Likewise. * lex.c (extract_interface_info): Likewise. * pt.c (lookup_template_class): Likewise. PR c++/12862 * name-lookup.c (pushdecl): Look up all namespace-scope entities in their corresponding namespace. * g++.old-deja/g++.jason/template18.C: Remove. * g++.old-deja/g++.jason/template37.C: Likewise. PR c++/12862 * g++.dg/lookup/ns1.C: New test. From-SVN: r74954
2003-12-21call.c: Fix comment formatting.Kazu Hirata1-8/+8
* call.c: Fix comment formatting. * class.c: Likewise. * cp-tree.h: Likewise. * cvt.c: Likewise. * cxx-pretty-print.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * error.c: Likewise. * except.c: Likewise. * init.c: Likewise. * name-lookup.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. From-SVN: r74916
2003-12-18re PR c++/12253 ([tree-ssa] ICE on conversion to std::string inside array ↵Jason Merrill1-4/+4
initialization) PR c++/12253 * init.c (build_vec_init): Initialization of an element from an initializer list is also a full-expression. * parser.c, pt.c, semantics.c: Rename constant_expression_p to integral_constant_expression_p. From-SVN: r74790
2003-12-18re PR c++/13262 ("xxx is private within this context" when initializing a ↵Kriang Lerdsuwanakij1-0/+10
*self-contained* template class) PR c++/13262 * pt.c (instantiate_decl): Wrap push_nested_class and pop_nested_class around cp_finish_decl call for static member variable. * g++.dg/template/access13.C: New test. From-SVN: r74780
2003-12-15re PR c++/13310 (Tree check error in dependent_template_p)Mark Mitchell1-0/+11
PR c++/13310 * pt.c (dependent_template_p): Handle OVERLOADs. PR c++/13310 * g++.dg/template/crash15.C: New test. From-SVN: r74649
2003-12-15re PR c++/13243 (Segfault on illegal template construct)Mark Mitchell1-3/+0
PR c++/13243 PR c++/12573 * parser.c (cp_parser_postfix_expression): Tighten handling of integral constant expressions. (cp_parser_unary_expression): Likewise. * pt.c (value_dependent_expression_p): Remove handling for COMPONENT_REFs. PR c++/13243 PR c++/12573 * g++.dg/template/crash14.C: New test. * g++.dg/template/dependent-expr3.C: Add dg-error markers. From-SVN: r74637
2003-12-13ChangeLog: Fix typos.Kazu Hirata1-1/+1
* ChangeLog: Fix typos. * ChangeLog.1: Likewise. * ChangeLog.2: Likewise. * call.c: Fix comment typos. * class.c: Likewise. * cxx-pretty-print.c: Likewise. * mangle.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * tree.c: Likewise. From-SVN: r74595
2003-12-13ggc-zone.c: Follow spelling conventions.Kazu Hirata1-1/+1
* ggc-zone.c: Follow spelling conventions. * config/rs6000/rs6000.c: Likewise. * pt.c: Likewise. * semantics.c: Likewise. * objc/objc-act.c: Likewise. From-SVN: r74590
2003-12-02re PR c++/10126 (ICE in convert_nontype_argument on using overload ↵Giovanni Bajo1-2/+3
resolution in template args) PR c++/10126 * pt.c (convert_nontype_argument): Handle default conversions while converting a pointer to member function. From-SVN: r74184
2003-12-02re PR c++/12573 (ICE (segfault) with Boost.Python)Giovanni Bajo1-0/+3
PR c++/12573 * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by looking into them recursively. From-SVN: r74172
2003-11-22* pt.c (tsubst) <ARRAY_REF>: Remove erroneous argument to build_nt.Kriang Lerdsuwanakij1-1/+1
From-SVN: r73834
2003-11-22re PR c++/5369 (template member friend declaration not honored)Kriang Lerdsuwanakij1-5/+147
PR c++/5369 * friend.c (is_friend): Handle member function of a class template as template friend. (do_friend): Likewise. * decl2.c (check_classfn): Add template_header_p parameter. * decl.c (start_decl): Adjust check_classfn call. (grokfndecl): Likewise. * pt.c (is_specialization_of_friend): New function. (uses_template_parms_level): Likewise. (push_template_decl_real): Use uses_template_parms_level. (tsubst_friend_function): Adjust check_classfn call. * cp-tree.h (check_classfn): Adjust declaration. (uses_template_parms_level): Add declaration. (is_specialization_of_friend): Likewise. * g++.dg/template/memfriend1.C: New test. * g++.dg/template/memfriend2.C: Likewise. * g++.dg/template/memfriend3.C: Likewise. * g++.dg/template/memfriend4.C: Likewise. * g++.dg/template/memfriend5.C: Likewise. * g++.dg/template/memfriend6.C: Likewise. * g++.dg/template/memfriend7.C: Likewise. * g++.dg/template/memfriend8.C: Likewise. * g++.old-deja/g++.pt/friend44.C: Remove a bogus error. From-SVN: r73833
2003-11-21re PR c++/12515 (Use of ?: operator in templated class causes ICE)Mark Mitchell1-1/+3
PR c++/12515 * pt.c (build_non_dependent_expr): Handle GNU extension to ?: operator. PR c++/12515 * g++.dg/ext/cond1.C: New test. From-SVN: r73820
2003-11-14re PR c++/2094 (unimplemented: use of `ptrmem_cst' in template type unification)Giovanni Bajo1-0/+22
PR c++/2094 * pt.c (unify): Add support for PTRMEM_CST and FIELD_DECL unification. From-SVN: r73577
2003-11-11cp-tree.h (DECL_NAMESPACE_ASSOCIATIONS): New macro.Jason Merrill1-2/+4
* cp-tree.h (DECL_NAMESPACE_ASSOCIATIONS): New macro. * name-lookup.c (parse_using_directive): New fn. (is_associated_namespace): New fn. (arg_assoc_namespace): Also check associated namespaces. * name-lookup.h: Declare new fns. * pt.c (maybe_process_partial_specialization): Allow specialization in associated namespace. * parser.c (cp_parser_using_directive): Accept attributes. Use parse_using_directive. From-SVN: r73468
2003-11-05re PR c++/11616 (Error message "instantiated from here" gives wrong location)Kriang Lerdsuwanakij1-0/+2
PR c++/11616 * pt.c (instantiate_pending_templates): Save and restore input_location. * g++.dg/template/instantiate5.C: New test. From-SVN: r73269
2003-10-24PR c++/12698, c++/12699, c++/12700, c++/12566Nathan Sidwell1-2/+1
cp: PR c++/12698, c++/12699, c++/12700, c++/12566 * cp-tree.h (THUNK_ALIAS_P, THUNK_ALIAS): New. (debug_class, debug_thunks): New. * class.c (dump_class_hierarchy_1): New break out from ... (dump_class_hierarchy): ... here. (dump_thunk, debug_thunks, debug_class): New. (update_vtable_entry_for_fn): Add ssizetype casts. Correct continued search for primary binfo via virtual. (build_vtbl_initializer): Follow covariant thunk alias. * method.c (make_thunk): Clear DECL_THUNKS of the thunk. (finish_thunk): Look for an alias of the covariant thunk and point to it. (use_thunk): We should never use an alias. * semantics.c (emit_associated_thunks): Do not emit aliases. PR c++/12566 * cp-tree.h (cp_fname_init): Add TYPE pointer param. * decl.c (cp_fname_init): Add TYPE pointer param. Set it. Don't create an ad-hoc ERROR_MARK. (cp_make_fname_decl): Adjust. * pt.c (tsubst_expr): Adjust. testsuite: PR c++/12698, c++/12699, c++/12700, c++/12566 * g++.dg/inherit/covariant9.C: New test. * g++.dg/inherit/covariant10.C: New test. * g++.dg/inherit/covariant11.C: New test. From-SVN: r72882
2003-10-22call.c: Fix comment formatting.Kazu Hirata1-4/+4
* call.c: Fix comment formatting. * class.c: Likewise. * cxx-pretty-print.c: Likewise. * init.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. From-SVN: r72828
2003-10-20PR c++/9781, c++/10583, c++/11862Kriang Lerdsuwanakij1-1/+4
PR c++/9781, c++/10583, c++/11862 * decl.c (cp_finish_decl): Exit immediately if decl is an error_mark_node. * pt.c (push_template_decl_real): Return error_mark_node for invalid template declaration of variable. * g++.dg/parse/crash13.C: New test. From-SVN: r72701
2003-10-18re PR c++/12495 (ICE in cp/typeck.c:907)Kriang Lerdsuwanakij1-8/+6
PR c++/12495 * pt.c (lookup_template_class): Handle when current_class_type is a local class. * g++.dg/template/crash21.C: New test. From-SVN: r72643
2003-10-17re PR c++/2513 (internal template template parameter causes ICE)Kriang Lerdsuwanakij1-7/+17
PR c++/2513 * decl.c (make_typename_type): Use dependent_type_p. (make_unbound_class_template): Likewise. * pt.c (instantiate_class_template): Increment processing_template_decl during substitution of template friend function. Preincrement processing_template_decl rather than postincrement. (get_mostly_instantiated_function_type): Increment processing_template_decl during partial substitution of function type. * g++.dg/template/typename5.C: New test. From-SVN: r72611
2003-10-09stmt.c (resolve_asm_operand_names): Call check_unique_operand_names here.Jason Merrill1-1/+12
* stmt.c (resolve_asm_operand_names): Call check_unique_operand_names here. (expand_asm_operands): Not here. (parse_input_constraint): No longer static. * tree.h: Declare it. * coverage.c (build_ctr_info_value): Use build_decl to make a VAR_DECL. (create_coverage): Likewise. java/ * parse.y (patch_assignment): Use make_node to create a BLOCK. * parse.h (BUILD_PTR_FROM_NAME): Use make_node to create a POINTER_TYPE. cp/ * tree.c (build_cplus_new): Use build_decl to create a VAR_DECL. (build_target_expr_with_type): Likewise. * pt.c (instantiate_class_template): Sanity check that our enclosing class has been instantiated. From-SVN: r72255
2003-10-08re PR c++/11097 (using template operator is broken)Giovanni Bajo1-0/+2
PR c++/11097 * pt.c (tsubst_decl): Substitute also the DECL_NAME node of USING_DECL. From-SVN: r72208
2003-09-23cp-tree.h (scope_kind): Add new enumerator.Gabriel Dos Reis1-3/+4
* cp-tree.h (scope_kind): Add new enumerator. (keep_next_level): Change parameter type to bool. (begin_scope): Change prototype. (pushlevel): Remove declaration. * decl.c (push_binding_level): Fold in begin_scope. Remove. (struct cp_binding_level): Remove tag_tranparent field. Make keep of bitsize one. (keep_next_level_flag): Make a bool. (cxx_scope_descriptor): Update scope names table (make_cxx_scope): Fold in begin_scope. Remove.. (namespace_scope_ht_size): New function. (begin_scope): Change prototype. Return a scope. Tidy. (kept_level_p): Update. (pushlevel): Remove. (maybe_push_cleanup_level): Simplify. (poplevel): Update for sk_cleanup and keep change. (print_binding_level): Likewise. (initial_push_namespace_scope): Fold in begin_scope. Remove. (push_namespace): Update. (pushtag): Likewise. (lookup_tag): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (cxx_init_decl_processing): Likewise. (start_function): Likewise. (begin_function_body): Likewise. (start_method): Likewise. * pt.c (push_inline_template_parms_recursive): Likewise. (begin_template_parm_list): Likewise. (begin_specialization): Likewise. * semantics.c (do_pushlevel): Likewise. (begin_compound_stmt): Likewise. (begin_stmt_expr): Likewise. From-SVN: r71683
2003-09-21Revert DECL_SOURCE_LOCATION -> TREE_LOCUS change.Richard Henderson1-14/+18
From-SVN: r71641
2003-09-21tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.Richard Henderson1-18/+14
* tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const. (TREE_FILENAME, TREE_LINENO): Likewise. (set_tree_locus, copy_tree_locus, set_tree_file_line): New. (TREE_LOCUS_SET_P): New. * c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c, diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c, print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c, tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c, config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match. ada/ * trans.c, utils.c: Update for DECL_SOURCE_LOCATION rename and change to const. cp/ * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, method.c, optimize.c, pt.c, semantics.c, tree.c: Update for DECL_SOURCE_LOCATION rename and change to const. f/ * com.c, ste.c: Update for DECL_SOURCE_LOCATION rename and change to const. java/ * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y, resource.c: Update for DECL_SOURCE_LOCATION rename and change to const. treelang/ * treetree.c: Update for DECL_SOURCE_LOCATION rename and change to const. From-SVN: r71636
2003-09-20c-format.c (gcc_diag_char_table): Add %J.Richard Henderson1-2/+1
* c-format.c (gcc_diag_char_table): Add %J. (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise. (check_format_types): Fix wanted_type name lookup. (init_dynamic_diag_info): Setup %J. * diagnostic.c (text_specifies_location): Implement %J. * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c, dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c, tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c, config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics. * tree-inline.c: Include intl.h (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason. * Makefile.in (tree-inline.o): Update. cp/ * decl.c, decl2.c, pt.c: Use %J in diagnostics. java/ * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics. testsuite/ * gcc.dg/format/gcc_diag-1.c: Add tests for %J. From-SVN: r71619
2003-09-20apparently managed not to commit the crucial part of c++/12332Nathan Sidwell1-2/+7
From-SVN: r71607
2003-09-19re PR c++/495 (ICE in in lookup_template_class, at cp/pt.c:3961)Kriang Lerdsuwanakij1-0/+2
PR c++/495 * pt.c (tsubst_friend_class): Only use innermost template arguments for the injected friend class template. * g++.dg/template/friend24.C: New test. From-SVN: r71574
2003-09-15re PR c++/12184 (ICE with trying to convert an incomplete type)Nathan Sidwell1-6/+8
cp: PR c++/12184 * typeck.c (convert_arguments): Return error_mark_node for an incomplete parameter. Make error message more informative. testsuite: PR c++/12184 * g++.dg/expr/call2.C: New test. From-SVN: r71402
2003-09-08re PR c++/5296 ([DR115] Pointers to functions and template functions behave ↵Mark Mitchell1-15/+23
different in deduction) PR c++/5296 * pt.c (try_one_overload): Add addr_p parameter. (resolve_overloaded_unification): Pass it. PR c++/5296 * g++.dg/rtti/typeid2.C: New test. From-SVN: r71209
2003-09-08c-decl.c (c_expand_body_1): Push and pop function context here.Richard Henderson1-2/+7
gcc/ * c-decl.c (c_expand_body_1): Push and pop function context here. * tree-optimize.c (tree_rest_of_compilation): ... not here. Take nested argument instead of computing nesting ourselves. gcc/cp/ * decl.c (finish_function): Clear current_function_decl. * decl2.c (mark_used): Don't push/pop gc context. * optimize.c (optimize_function): Likewise. * tree.c (cp_cannot_inline_tree_fn): Likewise. * pt.c (instantiate_decl): Inc/dec function_depth instead. * semantics.c (expand_body): Update for tree_rest_of_compilation nested argument. From-SVN: r71208
2003-09-05re PR c++/12163 (static_cast + explicit ctor regression)Mark Mitchell1-1/+2
PR c++/12163 * call.c (perform_direct_initialization): Correct logic for direct-initialization of a class type. PR c++/12146 * pt.c (lookup_template_function): Robustify. PR c++/12163 * g++.dg/expr/static_cast4.C: New test. PR c++/12146 * g++.dg/template/crash9.C: New test. From-SVN: r71115
2003-09-05re PR c++/11922 (ICE on type_unification_real)Nathan Sidwell1-3/+15
cp: PR c++/11922 * pt.c (tsubst_qualified_id): Make sure we get a non-type. (tsubst_expr, tsubst_copy_and_build): Pass false, not zero, as is_type_p to lookup_qualified_name. * semantics.c (finish_call_expr): Refactor some code. testsuite: PR c++/11922 * g++/dg/template/qualified-id1.C: New test. From-SVN: r71109
2003-09-05re PR c++/12037 (Spurious "statement has no effect" in templates)Nathan Sidwell1-1/+2
cp: PR c++/12037 * cp-tree.h (COMPOUND_EXPR_OVERLOADED): New. (build_min_non_dep): Declare. * tree.c (build_min): Propagate TREE_SIDE_EFFECTS. (build_min_non_dep): New. * cvt.c (convert_to_void): Don't explicitly copy TREE_SIDE_EFFECTS, TREE_NO_UNUSED_WARNING. * call.c (build_new_method_call): Use build_min_non_dep. * decl2.c (grok_array_decl): Likewise. (build_offset_ref_call_from_tree): Likewise. * typeck.c (finish_class_member_access_expr, build_x_indirect_ref, build_x_binary_op, build_x_unary_op, build_x_conditional_expr, build_x_compound_expr): Likewise. (build_static_cast, build_reinterpret_cast, build_const_cast): Propagate TREE_SIDE_EFFECTS inside a template. * typeck2.c (build_x_arrow): Use build_min_non_dep. (build_functional_cast): Propagate TREE_SIDE_EFFECTS inside a template. * rtti.c (build_dynamic_cast_1): Set DECL_IS_PURE. (build_dynamic_cast): Set TREE_SIDE_EFFECTS. * pt.c (build_non_dependent_expr): Check COMPOUND_EXPR_OVERLOADED. testsuite: PR c++/12037 * g++.dg/warn/noeffect4.C: New test. From-SVN: r71108
2003-09-04cp-tree.h (finish_sizeof, [...]): Remove.Nathan Sidwell1-3/+3
cp: * cp-tree.h (finish_sizeof, finish_alignof): Remove. (expr_sizeof): Replace with ... (cxx_sizeof_or_alignof_expr): ... here. (cxx_sizeof_or_alignof_type): Make complain parameter a bool. * parser.c (cp_parser_unary_expression): Commonize alignof and sizeof handling. * pt.c (tsubst_copy_and_build): Adjust alignof and sizeof substitution. * semantics.c (finish_sizeof, finish_alignof): Remove. * typeck.c (cxx_sizeof_or_alignof_type): Complain parameter becomes bool. Set TREE_READONLY. (expr_sizeof): Replace with ... (cxx_sizeof_or_alignof_expr): ... here. Clear TREE_SIDE_EFFECTS. From-SVN: r71054
2003-09-02re PR c++/11847 (reference does not work as template argument any more)Mark Mitchell1-2/+5
PR c++/11847 * pt.c (convert_nontype_argument): Correct representation of REFERENCE_TYPE expressions. PR c++/11847 * g++.dg/template/class1.C: New test. From-SVN: r71003
2003-09-02re PR c++/11808 (Wrong namespace lookup for template function when induced ↵Mark Mitchell1-21/+12
by a template parameter) PR c++/11808 * cp-tree.h (KOENIG_LOOKUP_P): New macro. (finish_call_expr): Change prototype. * parser.c (cp_parser_postfix_expression): Adjust call to finish_call_expr. * pt.c (tsubst_copy_and_build): Use KOENIG_LOOKUP_P. * semantics.c (finish_call_expr): Add koenig_p parameter. PR c++/11808 * g++.dg/expr/call1.C: New test. From-SVN: r70998
2003-09-01re PR c++/12114 ([3.3.2] Uninitialized memory accessed in dtor)Mark Mitchell1-1/+2
PR c++/12114 * g++.dg/init/ref9.C: New test. PR c++/11972 * g++.dg/template/nested4.C: New test. PR c++/12114 * cp-tree.h (initialize_reference): Change prototype. * call.c (initialize_reference): Add cleanup parameter. * decl.c (grok_reference_init): Likewise. (check_initializer): Likewise. (cp_finish_decl): Insert a CLEANUP_STMT if necessary. (duplicate_decls): When replacing an anticipated builtin, do not honor TREE_NOTHROW. * typeck.c (convert_for_initialization): Correct call to initialize_reference. PR c++/11972 * pt.c (dependent_type_p_r): Pass only the innermost template arguments to any_dependent_template_arguments_p. From-SVN: r70981
2003-09-01c-typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR.Josef Zlomek1-2/+0
* c-typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR. * convert.c (convert_to_integer): Kill BIT_ANDTC_EXPR. * fold-const.c (int_const_binop): Kill BIT_ANDTC_EXPR. (fold): Kill BIT_ANDTC_EXPR and label bit_and. * tree.def (BIT_ANDTC_EXPR): Kill. * error.c (dump_expr): Kill BIT_ANDTC_EXPR. * lex.c (init_operators): Kill BIT_ANDTC_EXPR. * pt.c (tsubst_copy): Kill BIT_ANDTC_EXPR. * typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR. (tsubst_copy_and_build): Kill BIT_ANDTC_EXPR. * com.c (ffecom_overlap_): Kill BIT_ANDTC_EXPR. (ffecom_tree_canonize_ref_): Kill BIT_ANDTC_EXPR. From-SVN: r70972
2003-08-30re PR c++/12093 (inconstitent error with templates/non-templates)Mark Mitchell1-0/+5
2003-08-29 Mark Mitchell <mark@codesourcery.com> PR c++/12093 * pt.c (build_non_dependent_expr): Do not build a NON_DEPENDENT_EXPR for a STRING_CST. 2003-08-29 Mark Mitchell <mark@codesourcery.com> PR c++/12093 * g++.dg/template/non-dependent4.C: New test. From-SVN: r70941
2003-08-29re PR middle-end/6196 (ICE in copy_to_mode_reg, at explow.c:711)Mark Mitchell1-0/+2
PR c++/6196 * pt.c (tsubst_copy_and_build): Correct handling of address-of-label extension. * semantics.c (finish_goto_stmt): The address of a label must go through the lvalue-to-rvalue conversion. PR c++/6196 * g++.dg/ext/label1.C: New test. * g++.dg/ext/label2.C: Likewise. From-SVN: r70932
2003-08-25re PR target/8795 ([PPC] Altivec related bugs concerning gcc 3.3 and mainline)Mark Mitchell1-8/+8
PR c++/8795 * tree.h (build_method_type_directly): Declare. * c-common.c (handle_vector_size_attributes): Handle METHOD_TYPEs. (vector_size_helper): Likewise. * tree.c (build_method_type_directly): New function. (build_method_type): Use it. PR c++/8795 * cp-tree.h (build_cplus_method_type): Remove. * call.c (standard_conversion): Use build_method_type_directly instead of build_cplus_method_type. * class.c (build_clone): Likewise. (adjust_clone_args): Likewise. * decl.c (build_ptrmem_type): Likewise. (grokdeclarator): Likewise. (check_function_type): Likewise. * decl2.c (grok_method_quals): Likewise. (maybe_retrofit_in_chrg): Likewise. * pt.c (copy_default_args_to_explicit_spec): Likewise. (tsubst_function_type): Likewise. (tsubst): Likewise. * tree.c (build_cplus_method_type): Remove. * typeck.c (merge_types): Use build_method_type_directly. PR c++/8795 * g++.dg/ext/altivec-1.C: New test. From-SVN: r70773
2003-08-23PR c++/641, c++/11876Kriang Lerdsuwanakij1-2/+4
PR c++/641, c++/11876 * friend.c (add_friend): Add complain parameter. (make_friend_class): Likewise. (do_friend): Adjust add_friend call. * decl.c (grokdeclarator): Adjust make_friend_class call. * parser.c (cp_parser_member_declaration): Likewise. (cp_parser_template_declaration_after_exp): Likewise. * pt.c (instantiate_class_template): Adjust make_friend_class and add_friend call. * cp-tree.h (make_friend_class): Adjust declaration. (add_friend): Likewise. * g++.dg/template/friend22.C: New test. * g++.dg/template/friend23.C: Likewise. From-SVN: r70732
2003-08-21re PR c++/11834 (template specialization not matched)Mark Mitchell1-0/+5
PR c++/11834 * pt.c (more_specialized): Bump processing_template_decl. PR c++/11834 * g++.dg/template/deduce2.C: New test. From-SVN: r70639
2003-08-20re PR c++/11945 (Incorrect warnings issued for comma-expressions inside ↵Nathan Sidwell1-0/+13
templates) cp: PR c++/11945 * pt.c (build_non_dependent_expr): Look inside COND_EXPR and COMPOUND_EXPR. * semantics.c (finish_expr_stmt): Always convert to void. * typeck.c (build_x_compound_exp): Always convert to void. testsuite: PR c++/11945 * g++.dg/warn/noeffect2.C: New test. From-SVN: r70606
2003-08-20re PR c++/11946 (fun and merriment with enums as function arguments)Mark Mitchell1-1/+11
PR c++/11946 * convert.c (convert_to_integer): Use CONVERT_EXPR (instead of NOP_EXPR) when necessary. * c-common.c (c_common_signed_or_unsigned_type): Correctly handle types with precisions other than those given by native machine modes. PR c++/11684 * cp-tree.h (grok_op_properties): Change prototype. * decl.c (grok_op_properties): Add complain parameter. (grokfndecl): Pass it. * pt.c (tsubst_decl): Adjust accordingly. PR c++/10926 * decl.c (start_method): Return immediately if push_template_decl does not like the declaration. * pt.c (push_template_decl_real): Disallow member template destructors. PR c++/11036.C * cp-tree.h (add_binding): Add prototype. * class.c (add_method): Set TYPE_HAS_DESTRUCTOR if appropriate. (maybe_warn_about_overly_private_class): Use CLASSTYPE_DESTRUCTORS. (pushclass): Adjust call to set_identifier_type_value. * decl.c (add_binding): Give it external linkage. (push_local_binding): Adjust call to add_binding. (push_class_binding): Likewise. (set_identifier_type_value_with_scope): Change prototype. Use add_binding for global bindings. (set_identifier_type_value): Adjust accordingly. (pushtag): Likewise. (pushdecl): Use set_identifier_type_value, not set_identifier_type_value_with_scope. (pushdecl_namespace_level): Adjust calls to SET_IDENTIFIER_TYPE_VALUE to pass a DECL. (pushdecl_class_level): Likewise. (lookup_tag): Use select_decl. (select_decl): Improve comment. (record_builtin_type): Do not call pushdecl. (cxx_init_decl_processing): Do not call xref_tag for bad_alloc. (cp_finish_decl): Adjust call to set_identifier_type_value. (check_elaborated_type_specifier): Improve checks for invalid uses of typedefs. (xref_tag): Adjust call to check_elaborated_type_specifier. * decl2.c (grokclassfn): Do not set TYPE_HAS_DESTRUCTOR. * name-lookup.c (set_namespace_binding): Use add_binding. * parser.c (cp_parser_simple_type_specifier): Return a TYPE_DECL, rather than an IDENTIFIER_NODE, to represent built-in types, if requested by the caller. (cp_parser_postfix_expression): Adjust call. (cp_parser_type_specifier): Likewise. (cp_parser_elaborated_type_specifier): Adjust call to check_elaborated_type_specifier. * typeck2.c (build_functional_cast): Do not perform name lookups. PR c++/10717 * decl.c (expand_static_init): Remove unncessary code. PR c++/10926 * g++.dg/template/dtor2.C: New test. PR c++/11684 * g++.dg/template/operator1.C: New test. * g++.dg/parse/operator4.C: New test. PR c++/11946.C * g++.dg/expr/enum1.C: New test. * gcc.dg/c99-bool-1.c: Remove bogus warning. PR c++/11036.C * g++.dg/parse/elab2.C: New test. * g++.dg/parse/typedef4.C: Change error message. * g++.old-deja/g++.robertl/eb133.C: Remove bogus error markers. * g++.old-deja/g++.robertl/eb133a.C: Remove bogus error markers. * g++.old-deja/g++.robertl/eb133b.C: Remove bogus error markers. From-SVN: r70593
2003-08-18re PR c++/11957 (wrong "warning: statement has no effect")Nathan Sidwell1-1/+1
cp: PR c++/11957 * cp-tree.h (finish_stmt_expr): Add bool parameter. * init.c (finish_init_stmts): Pass true to finish_stmt_expr. Don't adjust the stmt_expr here. (build_vec_init): Use finish_stmt_expr_expr, convert result to array type. * parser.c (cp_parser_primar_expression): Adjust finish_stmt_expr call. * pt.c (tsubst_copy): Likewise. * semantics.c (finish_stmt_expr): Add parameter. testsuite: PR c++/11957 * g++.dg/warn/noeffect1.C: New test. From-SVN: r70541
2003-08-18pt.c (instantiate_class_template): Push to class's scope before tsubsting base.Nathan Sidwell1-0/+8
cp: * pt.c (instantiate_class_template): Push to class's scope before tsubsting base. testsuite: * g++.dg/template/scope2.C: New test. * g++.dg/template/error2.C: Correct dg-error From-SVN: r70540