* decl2.c (import_export_decl): Because vtables always reference
virtual functions, even if they are inlined, don't allow
-fno-implement-inlines to not emit them, instead, emit them with
the vtable.
* decl.c (start_function): Likewise.
Fixes vtable1.C
From-SVN: r26416
* cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro.
* typeck.c (comptypes): If we get it, ignore attributes.
* class.c (instantiate_type): Use BASELINK_P. Change complain
parameter to flags; 2 means ignore attributes.
* call.c (build_op_delete_call): Pass it.
From-SVN: r26393
* decl.c (xref_tag): Only complain once about using a typedef-name
with 'struct'. Downgrade to pedwarn.
* decl.c (grokdeclarator): Allow [] syntax for zero-length array.
From-SVN: r26392
* error.c (dump_type_real): If a typename is a template-id, put
out the template arguments.
(dump_expr): Handle TEMPLATE_ID_EXPR.
* pt.c (lookup_template_class): Now that full arguments are
available everywhere, remove code that tried to guess them.
From-SVN: r26335
* cp-tree.h (BASELINK_P): New macro.
(SET_BASELINK_P): Likewise.
* init.c (build_member_call): Remove needless assignment in if
statement.
* search.c (lookup_field_r): Fix handling when we are looking
specifically for a type; these are not hidden by functions and
variables.
(lookup_member): Use SET_BASELINK_P.
* tree.c (is_overloaded_fn): Use BASELINK_P.
(really_overloaed_fn): Likewise.
(get_first_fn): Likewise.
From-SVN: r26219
1999-04-06 12:51 -0400 Zack Weinberg <zack@rabi.columbia.edu>
* cppinit.c (install_predefs): Delete function.
(cpp_start_read): Don't call install_predefs.
(cpp_handle_option): Remove case 'u' and all refs to
opts->inhibit_predefs.
(print_help): Don't mention -undef.
(initialize_builtins): Define __HAVE_BUILTIN_SETJMP__, to
match cccp.
* cpplib.h (struct cpp_options): Remove inhibit_predefs
member.
* cccp.c (predefs): Delete variable.
(main): Remove case 'u' in argument parse loop,
'inhibit_predefs' variable, and the code block that would
process CPP_PREDEFINES.
(initialize_builtins): Don't define __OBJC__, the driver will
do that.
* gcc.c (default_compilers): Remove -undef from all specs that
invoke a C preprocessor.
* ch/lang-specs.h: Likewise.
* cp/lang-specs.h: Likewise.
* f/lang-specs.h: Likewise.
* objc/lang-specs.h: Likewise.
From-SVN: r26212
* class.c (maybe_fixup_vptrs): Remove declaration.
(build_class_init_list): Likewise.
* decl.c (pushdecl_class_level): Call check_template_shadow here
...
(push_class_level_binding): ... not here.
* search.c (dfs_push_type_decls): Only avoid
template-self-reference TYPE_DECLs if they are from base classes.
From-SVN: r26202
1999-04-02 Mark Mitchell <mark@codesourcery.com>
* tinfo.h (__class_type_info): Fix illegal declaration.
* cp-tree.def (TEMPLATE_ID_EXPR): Update comment.
* cp-tree.h (INHERITED_VALUE_BINDING_P): New macro.
(IDENTIFIER_CLASS_VALUE): Improve documentation.
(is_properly_derived_from): Declare.
(invalidate_class_lookup_cache): Likewise.
(maybe_maybe_note_name_used_in_class): Likewise.
(note_name_declared_in_class): Likewise.
(push_using_decl): Remove duplicate declaration.
(id_in_current_class): Remove declaration.
(push_class_binding): Change prototype.
(clear_identitifer_class_values): Declare.
* call.c (is_properly_derived_from): Make it global.
(build_new_function_call): Be careful about updating candidates.
(build_new_method_call): Handle COMPONENT_REFs. Don't crash when
asked to make illegal calls.
* class.c: Include splay-tree.h.
(class_stack_node): Add names_used slot.
(check_member_decl_is_same_in_complete_scope): Remove.
(add_method): Fix comment. Push the declaration into class
scope.
(finish_struct_1): When popping the class, pop the bindings too.
Remove check for data member/function member conflict.
(finish_struct): Remove calls to
check_member_decl_is_same_in_complete_scope. Change calls to
popclass.
(pushclass): Clear names_used in the class stack entry.
Use invalidate_class_lookup_cache to remove cached entries, rather
than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE
before entering a new class. Remove dead code. Don't mess with
current_function_decl when pushing declarations.
(invalidate_class_lookup_cache): New function, split out from ...
(popclass): Here. Clean up names_used on our way out.
(instantiate_type): Adjust.
(build_self_reference): Don't push the declaration here.
(maybe_note_name_used_in_class): New function.
(note_name_declared_in_class): Likewise.
* decl.c (add_binding): Change prototype.
(find_class_binding_level): New function.
(innermost_nonclass_level): Likewise.
(current_binding_level): Update documentation.
(inner_binding_level): Remove. Replace with current_binding_level
throughout.
(push_binding_level): Remove special handling of
class_binding_level.
(pop_binding_level): Likewise. Use find_class_binding_level.
(suspend_binding_level): Likewise.
(global_bindings_p): Use innermost_nonclass_level.
(toplevel_bindings_p): Likewise.
(namespace_bindings_p): Likewise.
(pseudo_global_level_p): Likewise.
(push_binding): Clear INHERITED_VALUE_BINDING_P.
(add_binding): Check for illegal multiple declarations. Return a
value indicating whether or not the new binding was legal.
(push_local_binding): Skip over class binding levels. Check
return value from add_binding.
(push_class_binding): Set INHERITED_VALUE_BINDING_P. Call
note_name_declared_in_class.
(pushlevel_class): Remove "fake out the rest of the compiler"
code.
(poplevel_class): Reset IDENTIFIER_CLASS_VALUEs.
(clear_identifier_class_values): New function.
(pop_from_top_level): Use it.
(pop_everything): Tweak.
(maybe_process_template_type_declaration): Don't push the
declaration for the template here.
(pushtag): Don't push tag declarations into class scope here.
(pushdecl): Apply DeMorgan's law for readability.
(pushdecl_class_level): Remove special-case code for
TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions.
(push_class_level_bindng): Deal with inherited bindings.
(lookup_name_real): Remove special-case code for
TYPE_BEING_DEFINED, and some implicit typename magic.
(grokdeclarator): Handle COMPONENT_REF for a template function.
(build_enumerator): Don't call pushdecl_class_level here.
(id_in_current_class): Remove.
* decl2.c (grokfield): Don't call pushdecl_class_level or
check_template_shadow.
* errfn.c (cp_file_of): Don't declare.
(cp_line_of): Likewise.
* error.c (dump_decl): Handle an OVERLOAD.
(cp_file_of): Likewise.
(cp_line_of): Likewise.
* init.c (build_member_call): Handle a COMPONENT_REF.
* lex.c (do_identifier): Call maybe_note_name_used_in_class, not
pushdecl_class_level.
* method.c (hack_identifier): Build COMPONENT_REFs for references
to member templates as well as member functions. Remove dead
code.
* parse.y (left_curly): Remove.
(nonnested_type): Call maybe_note_name_used_in_class, not
pushdecl_class_level.
* parse.c: Regenerated.
(nested_name_specifier_1): Likewise.
* pt.c (check_explicit_specialization): Adjust, for robustness.
(check_template_shadow): Handle OVERLOADs.
(build_template_decl): Set DECL_CONSTRUCTOR_P on the
TEMPLATE_DECL, if appropriate.
* search.c (envelope_add_decl): Remove.
(dfs_pushdecls): Likewise.
(dfs_compress_decls): Likewise.
(dfs_push_decls): New function.
(dfs_push_type_decls): Likewise.
(setup_class_bindings): Likewise.
(template_self_reference_p): Likewise.
(lookup_field_r): Use it.
(looup_member): Remove old comment. Deal with ambiguity.
(push_class_decls): Use dfs_push_decls and dfs_push_type_decls,
and remove envelope processing.
* semantics.c (begin_class_definition): Let pushclass push
declarations for base classes.
(finish_member_declaration): Push declarations into class scope.
* typeck.c (build_component_ref): Just put an OVERLOAD into the
COMPONENT_REF, not a TREE_LIST of an OVERLOAD.
(build_x_function_call): Deal with OVERLOAD. Handle template-ids.
* Makefile.in (class.o): Depend on splay-tree.h.
From-SVN: r26133
* Makefile.in (hash.h): Generate using gperf language 'C', not
'KR-C', so gperf uses the `const' keyword on strings.
* gxx.gperf (resword): Const-ify a char*.
From-SVN: r26081
* cp-tree.h (add_friend): Declare.
(add_friends): Likewise.
* friend.c (add_friend): Make it global. Don't add to
DECL_BEFRIENDING_CLASSES if the befriending class is a template.
(add_friends): Make it global.
(make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the
befriending class is a template.
* parse.y (component_decl_1): Fix typo in comment.
* parse.c: Regenerated.
* pt.c (instantiate_class_template): Use add_friend and
add_friends rather that duplicating some of their functionality
here.
From-SVN: r26020
* gcc.c: Compile unconditionally all code formerly dependent
on #ifdef LANG_SPECIFIC_DRIVER.
* gccspec.c: New file with stub lang_specific_driver,
lang_specific_pre_link.
* Makefile.in: Link gccspec.o into xgcc. Add rule to compile
gccspec.c.
* cp/Make-lang.in: Remove all references to g++.o/g++.c.
Link g++ from gcc.o.
* f/Make-lang.in: Remove all references to g77.o/g77.c.
Link g77 from gcc.o.
* java/Make-lang.in: Remove all references to gcj.o/gcj.c.
Link gcj from gcc.o.
From-SVN: r25989
* typeck.c (common_type): Handle cv-qual unification for pointers
to members.
* decl.c (unqualified_namespace_lookup): Return error_mark_node
on error.
(lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing.
* lex.c (do_identifier): If we got error_mark_node, call
lookup_name again.
From-SVN: r25967
* cp-tree.h (lang_type): Remove has_assignment and
has_real_assignment. Add befriending_classes.
(TYPE_HAS_ASSIGNMENT): Remove.
(TYPE_HAS_REAL_ASSIGNMENT): Likewise.
(CLASSTYPE_BEFRIENDING_CLASSES): New macro.
(lang_decl): Document.
(DECL_BEFRIENDING_CLASSES): New macro.
(FRIEND_NAME): Move declaration to more obvious location.
(FRIEND_DECLS): Likewise.
* class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT.
* decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES.
(fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT.
(grok_op_properties): Likewise.
* friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS.
(add_friend): Likewise. Don't do weird things with assignment
operators. Update DECL_BEFRIENDING_CLASSES.
(add_friends): Don't do weird things with assignment operators.
(make_friend_class): Likewise. Update
CLASSTYPE_BEFRIENDING_CLASSES.
* pt.c (instantiate_class_template): Don't set
TYPE_HAS_ASSIGNMENT.
(tsubst_copy): Substitute the TREE_TYPE for more unary
expressions.
* ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT.
* search.c (protected_accessible_p): New function.
(friend_accessible_p): Likewise.
(accessible_p): Use them.
From-SVN: r25940
* pt.c (convert_nontype_argument): Don't create things that aren't
PTRMEM_CSTs when applying a qualification conversion to a
PTRMEM_CST.
From-SVN: r25929
* function.c: Include hash.h.
(insns_for_mem_entry): New struct.
(put_reg_into_stack): Take an optional hash-table mapping MEMs to
the INSNs that use them.
(fixup_var_refs): Likewise.
(put_addressof_into_stack): Likewise.
(purge_addressof_1): Likewise. Keep the hash-table up to date if
we add new instructions.
(fixup_var_refs_insns): Use it to avoid searching the entire
instruction chain.
(insns_for_mem_newfunc): New function.
(insns_for_mem_comp): Likewise.
(insns_for_mem_walk): Likewise.
(compute_insns_for_mem): Likewise.
(pop_function_context_from): Pass NULL for the hash-table.
(put_var_into_stack): Likewise.
(gen_mem_addressof): Likewise.
(flush_addressof): Likewise.
(purge_addressof): Call compute_insns_for_mem to pre-compute the
hash table.
* Makefile.in (OBJS): Include hash.o.
(function.o): Depend on hash.h.
* Makefile.in (OBJS): Don't mention hash.o.
(OBJDEPS): Likewise.
From-SVN: r25922
* decl2.c (finish_file): Set at_eof to 2 after expanding ctors.
* decl.c (expand_static_init): Make sure we don't add any after
then.
* decl.c (cp_finish_decl): Move intelligence about handling
DECL_COMDAT for variables from here...
* decl2.c (comdat_linkage): ...to here.
(maybe_make_one_only): Tweak.
(import_export_decl): Call comdat_linkage for variables, too.
(finish_file): Handle template statics properly.
From-SVN: r25920
* cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
Document internals of pointer-to-member-functions.
(DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc.
(PFN_FROM_PTRMEMFUNC): Similarly.
(build_type_conversion): Remove unused parameter.
(build_ptrmemfunc1): Declare.
(expand_ptrmemfunc_cst): New function.
(delta2_from_ptrmemfunc): Likewise.
(pfn_from_ptrmemfunc): Likewise.
* cvt.c (cp_convert_to_pointer): Remove unused parameter to
build_type_conversion. Use TYPE_PTRMEM_P for readability.
(convert_to_reference): Remove unused parameter to
build_type_conversion.
(ocp_convert): Likewise.
(build_user_type_conversion): Likewise.
* error.c (dump_expr): Handle NULL pointer-to-member functions.
* expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions.
* method.c (build_overload_value): Don't go splitting CONSTRUCTORs
open when handling pointer-to-member functions.
* pt.c (convert_nontype_argument): Clean up error messages. Be
more stringent with pointers-to-members.
* typeck.c (build_ptrmemfunc1): Don't declare. Make it global.
(build_unary_op): Tidy ever-so-slightly.
(build_conditional_expr): Remove extra parameter to
build_type_conversion.
(build_ptrmemfunc): Build PTRMEM_CSTs if we know what function
we're using.
(expand_ptrmemfunc_cst): Define.
(delta2_from_ptrmemfunc): Likewise.
(pfn_from_ptrmemfunc): Likewise.
From-SVN: r25913