summaryrefslogtreecommitdiff
path: root/gcc/cp
Commit message (Collapse)AuthorAgeFilesLines
* re PR c++/16021 (Tests for container swap specialisations FAIL in debug mode)Jason Merrill2006-01-262-3/+14
| | | | | | | | PR c++/16021 * name-lookup.c (parse_using_directive): Require strong using to name a nested namespace. From-SVN: r110282
* revert: cp-tree.h (do_poplevel): Remove prototype.Volker Reichelt2006-01-254-3/+14
| | | | | | | | | | | | Revert: * cp-tree.h (do_poplevel): Remove prototype. * semantics.c (do_poplevel): Add prototype. Make static. Revert: * cp-tree.h (default_conversion): Remove prototype. * typeck.c (default_conversion): Make static. From-SVN: r110214
* cp-tree.h (get_primary_binfo): Remove prototype.Volker Reichelt2006-01-256-17/+27
| | | | | | | | | | | | | | | | | | | * cp-tree.h (get_primary_binfo): Remove prototype. (push_using_decl): Likewise. (current_template_args): Likewise. (more_specialized_class): Likewise. (mark_class_instantiated): Likewise. (default_conversion): Likewise. (pfn_from_ptrmemfunc): Likewise. * class.c (get_primary_binfo): Add prototype, make static, simplify. * name-lookup.c (push_using_decl): Make static. * pt.c (current_template_args): Likewise. (more_specialized_class): Likewise. (mark_class_instantiated): Likewise. * typeck.c (default_conversion): Make static. (pfn_from_ptrmemfunc): Add prototype, make static. From-SVN: r110208
* typeck.c (build_binary_op): Use OPT_Wfloat_equal in warning().Dirk Mueller2006-01-242-2/+7
| | | | | | | | 2006-01-24 Dirk Mueller <dmueller@suse.de> * typeck.c (build_binary_op): Use OPT_Wfloat_equal in warning(). From-SVN: r110169
* re PR c++/25552 (Invalid destructor name accepted in friend declaration)Volker Reichelt2006-01-244-10/+26
| | | | | | | | | | | | | | PR c++/25552 * parser.c (cp_parser_unqualified_id): Check that destructor name and scope match. * call.c (check_dtor_name): Do not expect a BIT_NOT_EXPR. Adjust comment. Return early if possible. Use same_type_p to compare types. * typeck.c (lookup_destructor): Adjust call to check_dtor_name. * g++.dg/parse/dtor8.C: New test. From-SVN: r110168
* * semantics.c: Remove outdated comment.Mark Mitchell2006-01-242-5/+5
| | | | From-SVN: r110164
* cp-tree.h (do_poplevel): Remove prototype.Volker Reichelt2006-01-237-11/+21
| | | | | | | | | | | | | | | | | | | * cp-tree.h (do_poplevel): Remove prototype. * semantics.c (do_poplevel): Add prototype. Make static. * cp-tree.h (original_type): Remove prototype. * typeck.c (original_type): Make static. * cp-tree.h (declare_global_var): Remove prototype. * decl.c (declare_global_var): Make static. * cp-tree.h (implicitly_declare_fn): Remove prototype. * method.c (implicitly_declare_fn): Make static. * cp-tree.h (fold_decl_constant_value): Remove prototype. * pt.c (fold_decl_constant_value): Make static. From-SVN: r110140
* cp-tree.h (build_x_delete): Remove prototype.Volker Reichelt2006-01-233-29/+9
| | | | | | | | | * cp-tree.h (build_x_delete): Remove prototype. * init.c (build_vec_delete_1): Call build_op_delete_call directly and not via build_x_delete. (build_x_delete): Remove. From-SVN: r110138
* cp-tree.h (get_vtt_name): Remove prototype.Volker Reichelt2006-01-233-11/+7
| | | | | | | | * cp-tree.h (get_vtt_name): Remove prototype. * class.c (get_vtt_name): Remove. (build_vtt): Call mangle_vtt_for_type instead of get_vtt_name. From-SVN: r110136
* fix commentGabriel Dos Reis2006-01-222-2/+5
| | | | From-SVN: r110094
* re PR c++/10891 (code using dynamic_cast causes segfaults when -fno-rtti is ↵Gabriel Dos Reis2006-01-222-0/+14
| | | | | | | | | | | | | | | | | | used) 2006-01-22 Gabriel Dos Reis <gdr@integrable-solutions.net> PR c++/10891 * rtti.c (build_dynamic_cast): Reject dynamic_cast use if -fno-rtti. testsuite/ 2006-01-22 Gabriel Dos Reis <gdr@integrable-solutions.net> PR c++/10891 * g++.dg/rtti/no-rtti.C: New. From-SVN: r110092
* re PR c++/25895 (wrong code with ?: and derived class pointers)Mark Mitchell2006-01-224-30/+58
| | | | | | | | | | | | | | | | | | | | PR c++/25895 * class.c (build_base_path): Generate a NOP_EXPR instead of a COMPONENT_REF if the base and derived classes are at the same address. PR c++/25856 * decl.c (begin_destructor_body): Robustify. PR c++/25858 * parser.c (cp_parser_direct_declarator): Robustify. PR c++/25895 * g++.dg/inherit/conv2.C: New test. PR c++/25856 * g++.dg/parse/dtor7.C: New test. PR c++/25858 * g++.dg/template/crash44.C: New test. From-SVN: r110084
* parser.c (cp_lexer_next_token_is_keyword): Simplify.Volker Reichelt2006-01-202-12/+7
| | | | | | | | | | * parser.c (cp_lexer_next_token_is_keyword): Simplify. * parser.c (clear_decl_specs): Remove prototype. * parser.c (cp_parser_expression_fn): Remove. From-SVN: r110039
* call.c (add_builtin_candidates): Remove superfluous return.Volker Reichelt2006-01-204-6/+7
| | | | | | | | | * call.c (add_builtin_candidates): Remove superfluous return. * name-lookup.c (do_toplevel_using_decl): Likewise. * parser.c (cp_parser_type_specifier_seq): Likewise. (cp_parser_save_default_args): Likewise. From-SVN: r110022
* re PR c++/5520 (Add a warning to detect empty body of if statements (like in ↵Dirk Mueller2006-01-203-4/+18
| | | | | | | | | | | | | | | | | | | | | | | the C frontend)) 2006-01-20 Dirk Mueller <dmueller@suse.com> PR c++/5520 * c-parser.c (c_parser_if_body): Use build_empty_stmt() instead of a special NOP marker. * c-typeck.c (c_finish_if_stmt): Remove obsoleted special NOP marker handling. * c-common.h (empty_body_warning): Add forward declaration. * c-common.c (empty_body_warning): Add (from c_finish_if_stmt). Now uses IS_EMPTY_STMT() instead of special NOP markers. * semantics.c (finish_if_stmt): Call empty_body_warning. * parser.c (cp_parser_implicitly_scoped_statement): Mark empty statement with an empty stmt. * g++.dg/warn/empty-body.C: New. From-SVN: r110019
* re PR c++/22136 (Rejects old-style using declaration)Mark Mitchell2006-01-202-37/+68
| | | | | | | | | | | | PR c++/22136 * name-lookup.c (do_class_using_decl): Don't try to look up base classes in templates with dependent base types. PR c++/22136 * g++.dg/template/using10.C: New test. * g++.dg/temlpate/using11.C: Likewise. * g++.dg/inherit/using5.C: Tweak error messages. From-SVN: r110017
* re PR c++/25854 (Bogus diagnostic with '<type error>')Volker Reichelt2006-01-192-2/+12
| | | | | | | | | | PR c++/25854 * pt.c (maybe_process_partial_specialization): Return early on error_mark_node. * g++.dg/template/spec28.C: New test. From-SVN: r109975
* re PR c++/16829 (default parameter can be not one of the last in function)Volker Reichelt2006-01-195-8/+21
| | | | | | | | | | | | | | | | | PR c++/16829 * decl.c (start_preparsed_function): Check default arguments unconditionally. * name-lookup.c (pushdecl_maybe_friend): Check default arguments of all functions and function templates. * parser.c (cp_parser_late_parsing_default_args): Check default arguments. * decl2.c (check_default_args): Set missing default arguments to error_mark_node. * g++.dg/other/default2.C: New test. * g++.dg/other/default3.C: New test. From-SVN: r109950
* re PR c++/25836 (G++ does not allow a conversion of templated types)Mark Mitchell2006-01-194-10/+62
| | | | | | | | | | | | | | | | | | PR c++/25836 * cp-tree.h (push_class_stack): New function. (pop_class_stack): Likewise. * class.c (class_stack_node): Add hidden field. (pushclass): Clear it. (push_class_stack): New function. (pop_class_stack): Likewise. (currently_open_class): Ignore hidden classes. (currently_open_derived_class): Likewise. * name-lookup.c (push_to_top_level): Call push_class_stack. (pop_from_top_level): Call pop_class_stack. PR c++/25836 * g++.dg/template/init6.C: New test. From-SVN: r109945
* tree.c (find_tree_t, find_tree): Remove.Kazu Hirata2006-01-183-23/+5
| | | | | | | * tree.c (find_tree_t, find_tree): Remove. * cp-tree.h: Remove the prototype for find_tree. From-SVN: r109892
* search.c (lookup_conversions_r): Fix a pasto.Jakub Jelinek2006-01-182-1/+5
| | | | | | | | * search.c (lookup_conversions_r): Fix a pasto. * g++.dg/parse/lookup5.C: New test. From-SVN: r109877
* Update copyright from last checkin.Eric Christopher2006-01-182-2/+2
| | | | From-SVN: r109866
* call.c (convert_like_real): When issuing conversion warnings, depend on ↵Eric Christopher2006-01-183-58/+63
| | | | | | | | | | | | | | | | | | | | OPT_Wconversion. 2006-01-17 Eric Christopher <echristo@apple.com> * call.c (convert_like_real): When issuing conversion warnings, depend on OPT_Wconversion. * cvt.c (build_expr_type_conversion): Ditto. 2006-01-17 Eric Christopher <echristo@apple.com> * g++.old-deja/g++.warn/impint.C: Add -Wconversion. * g++.old-deja/g++.warn/impint2.C: Ditto. * g++.old-deja/g++.other/null1.C: Ditto. * g++.dg/warn/conv2.C: Ditto. * g++.dg/warn/conv4.C: New file. From-SVN: r109847
* name-lookup.c (lookup_namespace_name): Remove.Kazu Hirata2006-01-173-79/+6
| | | | | | | | * name-lookup.c (lookup_namespace_name): Remove. * name-lookup.h: Remove the prototype for lookup_namespace_name. From-SVN: r109821
* re PR c/25682 (ICE when using old sytle offsetof (with non zero start) as ↵Jakub Jelinek2006-01-172-0/+7
| | | | | | | | | | | | | | | | array size) PR c/25682 * c-typeck.c (build_unary_op): Fold offsetof-like expressions even when the pointer is not NULL. cp/ * decl.c (compute_array_index_type): After issuing not an integral constant-expression error, set size to 1 to avoid ICEs later on. testsuite/ * gcc.dg/pr25682.c: New test. * g++.dg/parse/array-size2.C: New test. From-SVN: r109812
* common.opt (ftoplevel-reorder): New option.Ian Lance Taylor2006-01-172-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
* Fix up recent entries by espindola.Ben Elliston2006-01-171-2/+2
| | | | From-SVN: r109804
* jvspec.c (lang_specific_spec_functions): removeRafael Espindola2006-01-162-6/+4
| | | | | | | | | | | | | * gcc/java/jvspec.c (lang_specific_spec_functions): remove * gcc/cppspec.c (lang_specific_spec_functions): remove * gcc/gcc.c (lookup_spec_function): use static_spec_functions directelly * gcc/gcc.h (lang_specific_spec_functions): remove * gcc/gccspec.c (lang_specific_spec_functions): remove * gcc/cp/g++spec.c (lang_specific_spec_functions): remove * gcc/fortran/gfortranspec.c (lang_specific_spec_functions): remove * gcc/treelang/spec.c (lang_specific_spec_functions): remove From-SVN: r109761
* * decl.c (check_initializer): Fix thinko.Gabriel Dos Reis2006-01-152-1/+5
| | | | From-SVN: r109728
* re PR c++/25663 (Trouble parsing nested templated constructor calls)Mark Mitchell2006-01-152-1/+7
| | | | | | | | | | PR c++/25663 * parser.c (cp_parser_direct_declarator): Use cp_parser_error instead of error. PR c++/25663 * g++.dg/template/ctor6.C: New test. From-SVN: r109713
* * pt.c (check_explicit_specialization): Use CP_DECL_CONTEXT even more.Jason Merrill2006-01-132-2/+4
| | | | From-SVN: r109693
* name-lookup.c (set_decl_namespace): Use CP_DECL_CONTEXT.Jason Merrill2006-01-133-3/+10
| | | | | | | * name-lookup.c (set_decl_namespace): Use CP_DECL_CONTEXT. * pt.c (check_explicit_specialization): Likewise. From-SVN: r109672
* re PR libstdc++/24660 (versioning weak symbols in libstdc++)Jason Merrill2006-01-123-6/+23
| | | | | | | | | PR libstdc++/24660 * pt.c (check_explicit_specialization): Handle namespace association. * name-lookup.c (set_decl_namespace): Likewise. From-SVN: r109647
* re PR debug/24824 (ICE: in build_abbrev_table, at dwarf2out.c:6427 with ↵Nathan Sidwell2006-01-122-1/+8
| | | | | | | | | | | | | -feliminate-dwarf2-dups) PR c++/24824 * class.c (handle_using_decl): Pass correct scope to cp_emit_debug_info_for_using. PR c++/24824 * g++.dg/debug/dwarf2-1.C: New. From-SVN: r109643
* tree.c (lvalue_p_1): Any part of a COMPONENT_REF affects packedness.Nathan Sidwell2006-01-112-3/+5
| | | | | | | | | * tree.c (lvalue_p_1): Any part of a COMPONENT_REF affects packedness. * g++.dg/ext/packed3.C: Add expected packed error. From-SVN: r109590
* parser.c (cp_parser_primary_expression): Document the grammar for the ↵Gabriel Dos Reis2006-01-062-0/+6
| | | | | | | | | built-in offsetof, a GNU extension. * parser.c (cp_parser_primary_expression): Document the grammar for the built-in offsetof, a GNU extension. From-SVN: r109431
* re PR c++/25632 (ICE with const int copied into two different functions)Zdenek Dvorak2006-01-042-2/+8
| | | | | | | | PR c++/25632 * init.c (constant_value_1): Unshare use of DECL_INITIAL. Fix a typo in condition. From-SVN: r109354
* typeck2.c: update copyright to 2006Chris Lattner2006-01-042-1/+9
| | | | | | | | | 2006-01-04 Chris Lattner <sabre@gnu.org> * typeck2.c: update copyright to 2006 (split_nonconstant_init_1): Set TREE_CONSTANT to true. From-SVN: r109348
* re PR c++/24782 (wrongly accepted nested private typedef)Mark Mitchell2006-01-042-11/+21
| | | | | | | | | | | PR c++/24782 * parser.c (cp_parser_nested_name_specifier_opt): Preserve access checks, even when parsing tentatively. PR c++/24782 * g++.dg/parse/access9.C: New test. * g++.dg/tc1/dr52.C: Tweak error markers. From-SVN: r109342
* directives.c (struct pragma_entry): Add is_deferred.Richard Henderson2006-01-043-171/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libcpp/ * directives.c (struct pragma_entry): Add is_deferred. Add ident entry to value union. (end_directive): Don't eat the line if in_deferred_pragma. (run_directive): Remove pragma hacks. (insert_pragma_entry): Remove. (new_pragma_entry): New. (register_pragma_1): Split out of register_pragma. Only handle the lookup tree and return the new entry. (cpp_register_pragma): Fill in the pragma entry here. (cpp_register_deferred_pragma): New. (register_pragma_internal): New. (_cpp_init_internal_pragmas): Use register_pragma_internal. (do_pragma): Allow pragma expansion after namespace. For deferred pragmas, don't slurp the line into a string. (destringize_and_run): Save tokens for deferred pragmas. (cpp_handle_deferred_pragma): Remove. * macro.c (builtin_macro): Remove pragma token hack. (_cpp_push_token_context): Rename from push_token_context and export. * internal.h (struct lexer_state): Add pragma_allow_expansion. (_cpp_push_token_context): Declare. * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return a token. Update the line number correctly if so. (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens. (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas. * include/cpplib.h (PRAGMA_EOL): New. (CPP_TOKEN_FLD_PRAGMA): New. (struct cpp_token): Add val.pragma. (struct cpp_options): Remove defer_pragmas. (cpp_handle_deferred_pragma): Remove. (cpp_register_deferred_pragma): Declare. gcc/ * c-lex.c (c_lex_with_flags) <CPP_PRAGMA>: Smuggle pragma id via integer constant. (pragma_lex): Remove. * c-pch.c (c_common_pch_pragma): Accept the name as an argument, rather than parsing it. * c-pragma.c (handle_pragma_weak, handle_pragma_redefine_extname, handle_pragma_extern_prefix): Add %< %> quotes. (registered_pragmas): New. (c_register_pragma_1): New. (c_register_pragma): Use it. (c_register_pragma_with_expansion): Likewise. (c_invoke_pragma_handler): New. (init_pragma): Use cpp_register_deferred_pragma directly for pch_preprocess. * c-pragma.h (enum pragma_kind): New. (pragma_handler): New. (c_invoke_pragma_handler): Declare. * c-common.c (c_parse_error): Pretty print CPP_PRAGMA and CPP_PRAGMA_EOL. * c-common.h (c_common_pch_pragma): Update decl. * Makefile.in (c-parser.o): Update dependencies. (GTFILES): Add c-pragma.h. * c-parser.c (struct c_token): Add pragma_kind. (struct c_parser): Add in_pragma. (c_lex_one_token): Always initialize keyword and pragma_kind. Extract data for CPP_PRAGMA. (c_parser_peek_2nd_token): Deny CPP_PRAGMA_EOL. (c_parser_consume_token): Don't allow CPP_PRAGMA unless errors. Don't allow CPP_PRAGMA_EOL if in_pragma. (c_parser_consume_pragma): New. (c_parser_skip_until_found): Stop on CPP_PRAGMA_EOL. (c_parser_skip_to_end_of_parameter): Likewise. (c_parser_skip_to_end_of_block_or_statement): Likewise. (c_parser_skip_to_pragma_eol): New. (c_parser_external_declaration): Handle CPP_PRAGMA. (c_parser_compound_statement_nostart): Likewise. (c_parser_statement_after_labels): Likewise. (c_parser_pragma): New. (pragma_lex): Likewise. (c_parser_pragma_pch_preprocess): New. (c_parser_new): Merge into ... (c_parse_file): ... here. Call c_parser_pragma_pch_preprocess. gcc/cp/ * lex.c (handle_pragma_java_exceptions): Fix whitespace. * parser.c (struct cp_token): Add pragma_kind. (eof_token): Update to match. (struct cp_lexer): Add in_pragma; rearrange next for better packing. (cp_parser_initial_pragma): New. (cp_lexer_new_main): Use it. Don't bother clearing c_lex_return_raw_strings. (cp_lexer_get_preprocessor_token): Always initialize keyword and pragma_kind fields. Handle CPP_PRAGMA. (cp_lexer_consume_token): Don't allow CPP_PRAGMA_EOL when in_pragma is set. (cp_lexer_handle_pragma): Remove. Update callers to cp_parser_pragma. (cp_lexer_print_token) <CPP_PRAGMA>: Don't print as a string. (cp_parser_skip_to_pragma_eol): New. (cp_parser_error): Use it. (cp_parser_skip_to_closing_parenthesis): Stop at CPP_PRAGMA_EOL; rearrange with switch statement. (cp_parser_skip_to_end_of_statement): Likewise. (cp_parser_skip_to_end_of_block_or_statement): Likewise. (cp_parser_skip_to_closing_brace): Likewise. (cp_parser_skip_until_found): Likewise. (cp_parser_statement): Add in_compound argument; update callers. Use it to decide how to handle pragma parsing. (cp_parser_labeled_statement): Add in_compound argument; pass it on to cp_parser_statement. (cp_parser_statement_seq_opt): Stop at CPP_PRAGMA_EOL. (cp_parser_declaration_seq_opt): Likewise. (cp_parser_parameter_declaration): Likewise. (cp_parser_member_specification_opt): Likewise. (cp_parser_function_definition_after_decl): Likewise. (cp_parser_cache_group): Handle CPP_PRAGMA/CPP_PRAGMA_EOL pairs. (cp_parser_pragma): New. (pragma_lex): New. gcc/testsuite/ * g++.dg/parse/pragma2.C: Update expected error lines. From-SVN: r109336
* decl.c (finish_constructor_body): create simple compound stmt instead of a ↵Dirk Mueller2006-01-042-25/+5
| | | | | | | | | | | if(1) { } construct. 2002-01-04 Dirk Mueller <dmueller@suse.com> * decl.c (finish_constructor_body): create simple compound stmt instead of a if(1) { } construct. From-SVN: r109331
* re PR c++/25492 (friend class nested in derived class problem)Mark Mitchell2006-01-043-1/+25
| | | | | | | | | | | | | | | | | PR c++/25492 * name-lookup.c (push_class_level_binding): When a derived class provides a type binding, eliminate any type binding from a base class. PR c++/25625 * repo.c (repo_emit_p): Always instantiate static data members initialized by constant expressions, so that there values are available. PR c++/25492 * g++.dg/lookup/friend9.C: New test. PR c++/25625 * g++.dg/template/repo5.C: New test. From-SVN: r109307
* re PR c++/25635 (Bogus cruft in error message for invalid operator declaration)Mark Mitchell2006-01-037-55/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/25635 * class.c (add_method): Set TYPE_HAS_CONVERSION for classes with a conversion operator. * decl.c (grokdeclarator): Do not set TYPE_HAS_CONVERSION here. PR c++/25638 * class.c (add_method): Never associate more than one destructor with a single class. PR c++/25637 * cp-tree.h (do_friend): Adjust prototype. * decl.c (grokfndecl): Make funcdef_flag a bool, not an int. (grokdeclarator): Likewise. Refine check for invalid declarations/definitions of member functions outside of their own class. * friend.c (do_friend): Make funcdef_flag a bool, not an int. PR c++/25633 * parser.c (cp_parser_mem_initializer_list): Check result of cp_parser_mem_initializer against error_mark_node, not NULL_TREE. (cp_parser_mem_initializer): Return error_mark_node for failure. PR c++/25634 * parser.c (cp_parser_template_parameter_list): Call begin_template_parm_list and end_template_parm_list here. (cp_parser_type_parameter): Not here. (cp_parser_template_declaration_after_export): Or here. (cp_parser_elaborated_type_specifier): Call cp_parser_check_template_parameters. * tree.c (build_target_expr_with_type): Use force_target_expr. PR c++/25635 * g++.dg/parse/operator6.C: New test. PR c++/25637 * g++.dg/parse/error29.C: New test. PR c++/25638 * g++.dg/parse/dtor6.C: New test. PR c++/25633 * g++.dg/parse/ctor3.C: New test. PR c++/25634 * g++.dg/template/class3.C: New test. From-SVN: r109270
* * decl2.c (mark_used): Fix typo in comment.Mark Mitchell2006-01-022-1/+5
| | | | From-SVN: r109239
* parser.c (cp_parser_using_declaration): Skip name-lookup on invalid scope.Volker Reichelt2006-01-022-1/+6
| | | | | | | | | * parser.c (cp_parser_using_declaration): Skip name-lookup on invalid scope. * g++.dg/lookup/using12.C: Tighten error marker. From-SVN: r109237
* c-pretty-print.h (struct c_pretty_print_info): Add new member "constant".Gabriel Dos Reis2005-12-303-12/+39
| | | | | | | | | | | | | | | | | | | | | | | | 2005-12-30 Gabriel Dos Reis <gdr@integrable-solutions.net> * c-pretty-print.h (struct c_pretty_print_info): Add new member "constant". (pp_constant): New macro. * c-pretty-print.c (pp_c_pretty_printer_init): Set pp->constant. cp/ 2005-12-30 Gabriel Dos Reis <gdr@integrable-solutions.net> * cxx-pretty-print.c (pp_cxx_constant): New. Print string-literal in parens if input program says so. (pp_cxx_primary_expression): Hand off constant printing to pp_cxx_constant. (pp_cxx_pretty_printer_init): Set pp->c_base.constant. (pp_cxx_expression): Use pp_cxx_constant for literals. * error.c (dump_expr): Use pp_constant for literals. From-SVN: r109176
* varasm.c (get_section): Use gcc_assert.Nathan Sidwell2005-12-292-4/+8
| | | | | | | | | | | | | * varasm.c (get_section): Use gcc_assert. cp: * method.c (make_thunk): Don't set comdat_linkage here. (use_thunk): Make thunk one only here, if thunk target is DECL_ONE_ONLY. testsuite: * g++.dg/abi/thunk3.C: New. * g++.dg/abi/thunk4.C: New. From-SVN: r109149
* re PR c++/25439 ("template<> int A<0>" accepted)Mark Mitchell2005-12-274-52/+88
| | | | | | | | | | | | | | | | | PR c++/25439 * decl.c (grokdeclarator): Remove dead code. * ptree.c (cxx_print_xnode): Handle BASELINK. * parser.c (make_id_declarator): Add sfk parameter. (cp_parser_direct_declarator): Do not pass TYPE_DECLs to make_id_declarator. (cp_parser_declarator_id): Simplify BASELINKs here. (cp_parser_member_declaration): Adjust calls to make_id_declarator. PR c++/25439 * g++.dg/parse/crash17.C: Adjust error markers. * g++.dg/template/error20.C: New test. From-SVN: r109079
* PR c++/23171, c++/23172, c++/25417.Mark Mitchell2005-12-278-86/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * c-decl.c (compound_literal_number): Remove. (build_compound_literal): Use set_compound_literal_name. * c-common.c (compound_literal_number): New variable. (set_compound_literal_name): New function. * c-common.h (set_compound_literal_name): Declare. PR c++/23171, c++/23172, c++/25417. * typeck.c (build_unary_op): Create temporary variables for compound literals whose addresses are taken. * init.c (expand_aggr_init_1): Use COMPOUND_LITERAL_P. * decl.c (reshape_init_vector): Likewise. (reshape_init): Give it external linkage. (check_initializer): Use COMPOUND_LITERAL_P. (initialize_artificial_var): Allow the initializer to be a CONSTRUCTOR. * call.c (make_temporary_var_for_ref_to_temp): Use create_temporary_var. * cp-tree.h (COMPOUND_LITERAL_P): New macro. (rehape_init): Declare. * typeck2.c (digest_init): Use COMPOUND_LITERAL_P. * semantics.c (finish_compound_literal): Use reshape_init. PR c++/23172 * g++.dg/ext/complit4.C: New test. PR c++/25417 * g++.dg/ext/complit5.C: Likewise. From-SVN: r109075
* re PR c++/24671 (ICE with zero-sized arrays)Mark Mitchell2005-12-232-0/+7
| | | | | | | | | PR c++/24671 * pt.c (instantiate_template): Handle SFINAE. PR c++/24671 * g++.dg/template/sfinae3.C: New test. From-SVN: r109022