* parse.y (after_type_declarator_intern): New nonterminal.
(after_type_declarator): Use it.
(direct_after_type_declarator): Likewise. Move above
nonnested_type to fix reduce/reduce conflict resolution.
(declmods): Reducing from just 'attributes' has EMPTY precedence.
* Makefile.in (CONFLICTS): Update.
* decl.c (define_label): Downgrade error for jumping over a
non-POD decl to pedwarn.
From-SVN: r26472
* cp-tree.h (popclass): Change declaration.
(pop_nested_class): Likewise.
(poplevel_class): Remove declaration.
* call.c (convert_default_argument): Pass no arguments to
popclass.
* class.c (finish_struct_1): Likewise.
(finish_struct): Likewise.
(popclass): Remove argument. Simplify code accordingly.
(pop_nested_class): Likewise.
* decl.c (poplevel_class): Declare it here, and make it static.
(poplevel): Handle class scopes.
(pop_level_class): Don't take an rgument. Simplify.
(pop_everything): Pass no arguments to pop_nested_class.
(cp_finish_decl): Pass no arguments to popclass.
(grokdeclarator): Pass no arguments to pop_nested_class.
(finish_function): Likewise.
* decl2.c (grokfield): Likewise.
(pop_scope): Pass no arguments to popclass.
* lex.c (do_pending_defargs): Pass no arguments to pop_nested_class.
* pt.c (instantiate_class_template): Move call to pushclass, and
document. Pass no arguments to popclass.
(regenerate_decl_from_template): Likewise.
From-SVN: r26454
* class.c (finish_struct_1): Look at the const-ness of the field's
type, not the TREE_READONLY-ness of the declaration.
* method.c (synthesize_method): Likewise.
* pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when
creating new declarations.
From-SVN: r26420
* 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