summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog755
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/call.c86
-rw-r--r--gcc/cp/class.c6
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/cvt.c247
-rw-r--r--gcc/cp/decl.c100
-rw-r--r--gcc/cp/decl2.c26
-rw-r--r--gcc/cp/except.c124
-rw-r--r--gcc/cp/exception.cc19
-rw-r--r--gcc/cp/init.c76
-rw-r--r--gcc/cp/lang-options.h2
-rw-r--r--gcc/cp/method.c243
-rw-r--r--gcc/cp/pt.c3
-rw-r--r--gcc/cp/spew.c8
-rw-r--r--gcc/cp/tinfo2.cc2
-rw-r--r--gcc/cp/tree.c15
-rw-r--r--gcc/cp/typeck.c20
18 files changed, 738 insertions, 998 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d945770bc4f..2f9b6e2029e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,7 +1,100 @@
+Wed Apr 23 14:43:06 1997 Mike Stump <mrs@cygnus.com>
+
+ * init.c (init_decl_processing): Add supoprt for setjmp/longjmp based
+ exception handling.
+ * except.c (init_exception_processing): Likewise.
+ (expand_end_catch_block): Likewise.
+ (expand_exception_blocks): Likewise.
+ (expand_throw): Likewise.
+ * exception.cc (__default_terminate): Likewise.
+
+ * init.c (perform_member_init): Use new method of expr level
+ cleanups, instead of cleanups_this_call and friends.
+ (emit_base_init): Likewise.
+ (expand_aggr_vbase_init_1): Likewise.
+ (expand_vec_init): Likewise.
+ * decl.c (cp_finish_decl): Likewise.
+ (expand_static_init): Likewise.
+ (store_parm_decls): Likewise.
+ (cplus_expand_expr_stmt): Likewise.
+ * decl2.c (finish_file): Likewise.
+
+ * Make-lang.in (exception.o): Ok to compile with -O now.
+
+ * decl.c (maybe_build_cleanup_1): We no longer have to unsave, as
+ we know it will be done later by the backend.
+
+ * decl2.c (lang_f_options): Remove support for short temps.
+ * lang-options.h: Likewise.
+
+Wed Apr 23 04:12:06 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * tree.c (varargs_function_p): New fn.
+ * method.c (emit_thunk): Replace broken generic code with code to
+ generate a heavyweight thunk function.
+
+Tue Apr 22 02:45:18 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (process_template_parm): pedwarn about floating-point parms.
+
+ * decl.c (grokdeclarator): inline no longer implies static.
+
+ * spew.c (yylex): Always return the TYPE_DECL if we got a scope.
+
+Mon Apr 21 15:42:27 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * class.c (check_for_override): The signature of an overriding
+ function is not changed.
+
+ * call.c (build_over_call): Move setting of conv into the loop.
+
+Sun Apr 20 16:24:29 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (build_user_type_conversion_1): Really ignore rvalue
+ conversions when looking for a REFERENCE_TYPE.
+
+ * cvt.c (build_up_reference): Eviscerate, use build_unary_op.
+ * cp-tree.h (TREE_REFERENCE_EXPR): #if 0.
+ * typeck.c (decay_conversion): Don't set TREE_REFERENCE_EXPR.
+ (build_unary_op): Likewise.
+ * call.c (build_over_call): See through a CONVERT_EXPR around the
+ ADDR_EXPR for on a temporary.
+ * typeck.c (c_expand_return): See through a CONVERT_EXPR around
+ the ADDR_EXPR for a local variable.
+
+Fri Apr 18 12:11:33 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (build_user_type_conversion_1): If we're trying to
+ convert to a REFERENCE_TYPE, only consider lvalue conversions.
+ (build_new_function_call): Print candidates.
+ (implicit_conversion): Try a temp binding if the lvalue conv is BAD.
+ (reference_binding): Binding a temporary of a reference-related type
+ is BAD.
+
+Thu Apr 17 14:37:22 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * inc/typeinfo (type_info::before): Add cv-qualifier-seq.
+ * tinfo2.cc (type_info::before): Likewise.
+
+Mon Apr 14 12:38:17 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (implicit_conversion): Oops.
+
+Fri Apr 11 02:18:30 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (implicit_conversion): Try to find a reference conversion
+ before binding a const reference to a temporary.
+
+Wed Apr 2 12:51:36 1997 Mike Stump <mrs@cygnus.com>
+
+ * exception.cc (__default_unexpected): Call terminate by default,
+ so that if the user overrides terminate, the correct function will
+ be called.
+
Wed Mar 19 14:14:45 1997 Mike Stump <mrs@cygnus.com>
* parse.y (left_curly): Avoid trying to use any fields of
- error_mark_node, as there aren't any.
+ error_mark_node, as there aren't any.
Thu Mar 13 16:33:22 1997 Jason Merrill <jason@yorick.cygnus.com>
@@ -10,7 +103,7 @@ Thu Mar 13 16:33:22 1997 Jason Merrill <jason@yorick.cygnus.com>
Wed Mar 12 13:55:10 1997 Hans-Peter Nilsson <Hans-Peter.Nilsson@axis.se>
- * call.c (add_template_candidate): Initialize the variable "dummy".
+ * call.c (add_template_candidate): Initialize the variable "dummy".
Mon Mar 10 15:13:14 1997 Brendan Kehoe <brendan@canuck.cygnus.com>
@@ -156,7 +249,7 @@ Mon Mar 3 12:14:54 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
Sun Mar 2 11:04:43 1997 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_scoped_method_call): Complain if the scope isn't a
- base.
+ base.
Wed Feb 26 11:31:06 1997 Jason Merrill <jason@yorick.cygnus.com>
@@ -183,11 +276,11 @@ Mon Feb 24 15:00:12 1997 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_field_call): Don't look for [cd]tor_identifier.
* decl2.c (delete_sanity): Remove meaningless use of
- LOOKUP_HAS_IN_CHARGE.
+ LOOKUP_HAS_IN_CHARGE.
* decl.c (finish_function): Use build_scoped_method_call instead
- of build_delete for running vbase dtors.
+ of build_delete for running vbase dtors.
* init.c (build_delete): Call overload resolution code instead of
- duplicating it badly.
+ duplicating it badly.
Thu Feb 20 15:12:15 1997 Jason Merrill <jason@yorick.cygnus.com>
@@ -222,8 +315,8 @@ Fri Feb 14 16:57:05 1997 Mike Stump <mrs@cygnus.com>
Tue Feb 11 13:50:48 1997 Mike Stump <mrs@cygnus.com>
* new1.cc: Include a declaration for malloc, to avoid warning, and
- avoid lossing on systems that require one (ones that define malloc
- in xm.h).
+ avoid lossing on systems that require one (ones that define malloc
+ in xm.h).
Mon Feb 10 22:51:13 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
@@ -237,7 +330,7 @@ Mon Feb 10 22:51:13 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de
Fri Feb 7 15:43:34 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (xref_basetypes): Allow a base class that depends on
- template parms to be incomplete.
+ template parms to be incomplete.
* decl2.c (build_expr_from_tree): Support typeid(type).
* rtti.c (get_typeid): Support templates.
@@ -253,8 +346,8 @@ Tue Feb 4 11:28:24 1997 Jason Merrill <jason@yorick.cygnus.com>
Mon Feb 3 18:41:12 1997 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (tsubst, case FUNCTION_DECL): Lose obsolete code that
- smashes together template and non-template decls of the same
- signature.
+ smashes together template and non-template decls of the same
+ signature.
Thu Jan 30 19:18:00 1997 Jason Merrill <jason@yorick.cygnus.com>
@@ -320,8 +413,8 @@ Tue Jan 28 15:25:09 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
Mon Jan 27 19:21:29 1997 Mike Stump <mrs@cygnus.com>
* except.c (expand_throw): Don't expand the cleanup tree here,
- since we are not going to write the rtl out. Fixes problem with
- -g -O on SPARC.
+ since we are not going to write the rtl out. Fixes problem with
+ -g -O on SPARC.
Mon Jan 27 16:24:35 1997 Sean McNeil <sean@mcneil.com>
@@ -348,12 +441,12 @@ Sat Jan 25 08:50:03 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
Fri Jan 24 17:52:54 1997 Mike Stump <mrs@cygnus.com>
* decl.c (duplicate_decls): pedwarn mismatched exception
- specifications.
+ specifications.
Thu Jan 23 18:18:54 1997 Mike Stump <mrs@cygnus.com>
* call.c (build_new_method_call): Don't display the invisible
- argument for controlling virtual bases.
+ argument for controlling virtual bases.
Thu Jan 23 16:48:10 1997 Mike Stump <mrs@cygnus.com>
@@ -372,25 +465,25 @@ Thu Jan 23 16:39:06 1997 Jason Merrill <jason@yorick.cygnus.com>
* lex.c (cons_up_default_function): Fix return type of synth op=.
* init.c (emit_base_init): Add warnings for uninitialized members
- and bases.
+ and bases.
* decl.c (xref_basetypes): Add warning for non-polymorphic type
- with destructor used as base type.
+ with destructor used as base type.
* decl.c (grok_op_properties): Add warning for op= returning void.
* typeck.c (c_expand_return): Add warning for op= returning anything
other than *this.
* class.c (finish_struct_1): Add warning for class with pointers
- but not copy ctor or copy op=.
+ but not copy ctor or copy op=.
* cp-tree.h (TI_PENDING_TEMPLATE_FLAG): New macro.
* pt.c (add_pending_template): Use it instead of LANG_FLAG_0.
(instantiate_template): If -fexternal-templates, add this
- instantiation to pending_templates.
+ instantiation to pending_templates.
* decl2.c (copy_assignment_arg_p): Disable old hack to support
- Booch components.
+ Booch components.
Tue Jan 21 18:32:04 1997 Mike Stump <mrs@cygnus.com>
@@ -399,7 +492,7 @@ Tue Jan 21 18:32:04 1997 Mike Stump <mrs@cygnus.com>
Mon Jan 20 17:59:51 1997 Jason Merrill <jason@yorick.cygnus.com>
* call.c (standard_conversion): Handle getting references. Tack
- on RVALUE_CONV here. Do it for non-class types, too.
+ on RVALUE_CONV here. Do it for non-class types, too.
(reference_binding): Pass references to standard_conversion.
(implicit_conversion): Likewise.
(add_builtin_candidate): Disable one ?: kludge.
@@ -415,10 +508,10 @@ Mon Jan 20 14:53:13 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
Mon Jan 20 14:43:49 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (finish_function): Also zero out DECL_INCOMING_RTL for
- the arguments.
+ the arguments.
* error.c (dump_expr, TEMPLATE_CONST_PARM): Don't require
- current_template_parms.
+ current_template_parms.
Fri Jan 17 10:25:42 1997 Jason Merrill <jason@yorick.cygnus.com>
@@ -476,17 +569,17 @@ Wed Jan 8 13:09:54 1997 Jason Merrill <jason@yorick.cygnus.com>
the correct order.
* pt.c (instantiate_class_template): Don't initialize
- BINFO_BASETYPES until the vector is filled out.
+ BINFO_BASETYPES until the vector is filled out.
(unify): Don't abort on conflicting bindings, just fail.
(instantiate_decl): Do push_tinst_level before any tsubsting.
* method.c (build_overload_value): Handle getting a
- TEMPLATE_CONST_PARM for a pointer.
+ TEMPLATE_CONST_PARM for a pointer.
Tue Jan 7 14:00:58 1997 Jason Merrill <jason@yorick.cygnus.com>
* init.c (expand_member_init): Don't give 'not a base' error for
- templates.
+ templates.
* pt.c (instantiate_decl): Call import_export_decl later.
@@ -511,7 +604,7 @@ Tue Dec 31 20:25:50 1996 Mike Stump <mrs@cygnus.com>
Tue Dec 31 15:16:56 1996 Mike Stump <mrs@cygnus.com>
* init.c (perform_member_init): Make sure the partial EH cleanups
- live on the function_obstack.
+ live on the function_obstack.
Fri Dec 27 10:31:40 1996 Paul Eggert <eggert@twinsun.com>
@@ -590,8 +683,8 @@ Thu Dec 5 02:11:28 1996 Jason Merrill <jason@yorick.cygnus.com>
Tue Dec 3 23:18:37 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (grok_x_components): Remove synthesized methods from
- TYPE_METHODS of an anonymous union, complain about member
- functions.
+ TYPE_METHODS of an anonymous union, complain about member
+ functions.
* decl.c (shadow_tag): Wipe out memory of synthesized methods in
anonymous unions.
(finish_function): Just clear the DECL_RTL of our arguments.
@@ -606,7 +699,7 @@ Fri Nov 29 21:54:17 1996 Jason Merrill <jason@yorick.cygnus.com>
Wed Nov 27 14:47:15 1996 Bob Manson <manson@charmed.cygnus.com>
* typeck.c (build_component_ref): Don't die if COMPONENT isn't a
- IDENTIFIER_NODE.
+ IDENTIFIER_NODE.
Wed Nov 27 16:05:19 1996 Michael Meissner <meissner@tiktok.cygnus.com>
@@ -646,9 +739,9 @@ Thu Nov 21 16:30:24 1996 Jason Merrill <jason@yorick.cygnus.com>
Wed Nov 20 18:47:31 1996 Bob Manson <manson@charmed.cygnus.com>
* g++.c (main): Make sure arglist has a final NULL entry. Add
- PEXECUTE_LAST to the flags passed to pexecute, as otherwise
- stdin/stdout of the invoked program are redirected to
- nowheresville.
+ PEXECUTE_LAST to the flags passed to pexecute, as otherwise
+ stdin/stdout of the invoked program are redirected to
+ nowheresville.
Tue Nov 19 16:12:44 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -673,7 +766,7 @@ Mon Nov 18 17:05:26 1996 Jason Merrill <jason@yorick.cygnus.com>
Mon Nov 18 16:10:43 1996 Mike Stump <mrs@cygnus.com>
* cvt.c (cp_convert_to_pointer): Avoid thinking a POINTER_TYPE
- (METHOD_TYPE) is a TYPE_PTRMEMFUNC_P.
+ (METHOD_TYPE) is a TYPE_PTRMEMFUNC_P.
Thu Nov 14 23:18:17 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -682,7 +775,7 @@ Thu Nov 14 23:18:17 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (finish_vtable_vardecl): Likewise.
* decl.c (pushtag, finish_enum): Likewise.
* lex.c (check_newline): Use debug_* instead of calling *out
- functions directly.
+ functions directly.
Thu Nov 14 15:21:46 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -692,12 +785,12 @@ Thu Nov 14 15:21:46 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Wed Nov 13 12:32:07 1996 Jason Merrill <jason@yorick.cygnus.com>
* class.c (finish_struct_1): A class has a non-trivial copy
- constructor if it has virtual functions.
+ constructor if it has virtual functions.
* cvt.c (cp_convert): Always call a constructor.
* call.c (reference_binding): Still tack on a REF_BIND
- for bad conversions.
+ for bad conversions.
(build_user_type_conversion_1): Propagate ICS_BAD_FLAG.
* typeck.c (convert_arguments): Pass LOOKUP_ONLYCONVERTING.
@@ -820,14 +913,14 @@ Fri Nov 8 17:38:44 1996 Jason Merrill <jason@yorick.cygnus.com>
* search.c (note_debug_info_needed): Don't do anything if we're in a
template.
* method.c (synthesize_method): For non-local classes,
- push_to_top_level first.
+ push_to_top_level first.
Fri Nov 8 11:52:28 1996 Bob Manson <manson@charmed.cygnus.com>
* typeck.c (get_delta_difference): Add no_error parameter.
(build_ptrmemfunc): Call get_delta_difference with no_error set;
- we don't want error messages when converting unrelated
- pointer-to-member functions.
+ we don't want error messages when converting unrelated
+ pointer-to-member functions.
Thu Nov 7 11:16:24 1996 Mike Stump <mrs@cygnus.com>
@@ -837,7 +930,7 @@ Thu Nov 7 11:16:24 1996 Mike Stump <mrs@cygnus.com>
Tue Nov 5 17:12:05 1996 Mike Stump <mrs@cygnus.com>
* cvt.c (cp_convert_to_pointer): Move code for conversions from
- (::*)() to void* or (*)() up a bit, so that we can convert from
+ (::*)() to void* or (*)() up a bit, so that we can convert from
METHOD_TYPEs as well.
Tue Nov 5 14:54:17 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -870,7 +963,7 @@ Fri Nov 1 08:53:17 1996 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h (DIRECT_BIND): Change from INDIRECT_BIND.
* decl.c (grok_reference_init): Pass DIRECT_BIND.
* cvt.c (build_up_reference): Don't mark 'this' addressable. Use
- DIRECT_BIND.
+ DIRECT_BIND.
* call.c (convert_like): Don't pass INDIRECT_BIND.
* typeck.c (convert_arguments): Likewise.
* typeck.c (mark_addressable): Allow &this if flag_this_is_variable.
@@ -878,7 +971,7 @@ Fri Nov 1 08:53:17 1996 Jason Merrill <jason@yorick.cygnus.com>
Thu Oct 31 17:08:49 1996 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (mark_addressable): Support TARGET_EXPR, unify with
- similar code in build_up_ref.
+ similar code in build_up_ref.
* cvt.c (build_up_reference): Drastically simplify.
Mon Oct 28 12:45:05 1996 Jeffrey A Law (law@cygnus.com)
@@ -886,8 +979,8 @@ Mon Oct 28 12:45:05 1996 Jeffrey A Law (law@cygnus.com)
* typeck.c (signed_or_unsigned_type): If the given type already
as the correct signedness, then just return it.
- * typeck.c ({un,}signed_type): If can't do anything, call
- signed_or_unsigned_type.
+ * typeck.c ({un,}signed_type): If can't do anything, call
+ signed_or_unsigned_type.
Thu Oct 24 14:21:59 1996 Bob Manson <manson@charmed.cygnus.com>
@@ -897,7 +990,7 @@ Thu Oct 24 14:21:59 1996 Bob Manson <manson@charmed.cygnus.com>
Wed Oct 23 00:43:10 1996 Jason Merrill <jason@gerbil.cygnus.com>
* class.c (finish_struct_1): Avoid empty structs by adding a field
- so layout_type gets the mode right.
+ so layout_type gets the mode right.
* typeck.c (c_expand_return): Drastically simplify.
@@ -912,32 +1005,32 @@ Fri Oct 18 16:03:48 1996 Jason Merrill <jason@yorick.cygnus.com>
Thu Oct 17 11:31:59 1996 Mike Stump <mrs@cygnus.com>
* cvt.c (convert_to_pointer_force): Add code to support pointer to
- member function to pointer to function conversions.
+ member function to pointer to function conversions.
* init.c (resolve_offset_ref): Add code to allow faked up objects,
- ignoring them if they are not used, and giving an error, if they
- are needed.
+ ignoring them if they are not used, and giving an error, if they
+ are needed.
* typeck.c (get_member_function_from_ptrfunc): Fold e1 to improve
- code, and so that we can give an error, if we needed an object,
- and one was not provided.
+ code, and so that we can give an error, if we needed an object,
+ and one was not provided.
(build_c_cast): Don't call default_conversion when we want to
- convert to pointer to function from a METHOD_TYPE.
+ convert to pointer to function from a METHOD_TYPE.
Mon Oct 14 00:28:51 1996 Jason Merrill <jason@yorick.cygnus.com>
* Make-lang.in (cplib2.ready): Fix logic.
* decl.c (shadow_tag): Only complain about non-artificial function
- members.
+ members.
* class.c (finish_struct_1): Add synthesized methods to TYPE_METHODS.
Fri Oct 11 16:12:40 1996 Jason Merrill <jason@yorick.cygnus.com>
* expr.c (cplus_expand_expr): Pre-tweak call_target like
- expand_inline_function would.
+ expand_inline_function would.
* pt.c (mark_decl_instantiated): If extern_p, call
- mark_inline_for_output.
+ mark_inline_for_output.
Thu Oct 10 15:58:08 1996 Mike Stump <mrs@cygnus.com>
@@ -950,8 +1043,8 @@ Thu Oct 10 15:58:08 1996 Mike Stump <mrs@cygnus.com>
Tue Oct 8 12:43:51 1996 Bob Manson <manson@charmed.cygnus.com>
* pt.c (tsubst): If the function decl isn't a member of this
- template, return a copy of the decl (including copying the
- lang-specific part) so we don't hose ourselves later.
+ template, return a copy of the decl (including copying the
+ lang-specific part) so we don't hose ourselves later.
Thu Oct 3 16:24:28 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -970,9 +1063,9 @@ Wed Oct 2 21:58:01 1996 Bob Manson <manson@charmed.cygnus.com>
Mon Sep 30 13:38:24 1996 Jason Merrill <jason@yorick.cygnus.com>
* class.c, cp-tree.h, cvt.c, decl.c, decl2.c, gxx.gperf, hash.h,
- lex.c, method.c, parse.y, typeck.c, typeck2.c: Remove
- warn_traditional and warn_strict_prototypes; remove ancient
- 'overload' code; remove references to flag_traditional.
+ lex.c, method.c, parse.y, typeck.c, typeck2.c: Remove
+ warn_traditional and warn_strict_prototypes; remove ancient
+ 'overload' code; remove references to flag_traditional.
Mon Sep 30 12:58:40 1996 Mike Stump <mrs@cygnus.com>
@@ -986,12 +1079,12 @@ Sun Sep 29 03:12:01 1996 Jason Merrill <jason@yorick.cygnus.com>
* Make-lang.in (cplib2.txt): Also depend on the headers.
* rtti.c (get_tinfo_var): Don't assume that POINTER_SIZE ==
- INT_TYPE_SIZE.
+ INT_TYPE_SIZE.
(expand_class_desc): Use USItype for offset field.
* tinfo.h (struct __class_type_info): Likewise.
* method.c (build_overload_int): TYPE_PRECISION should be applied
- to types.
+ to types.
Sat Sep 28 14:44:50 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1016,7 +1109,7 @@ Fri Sep 27 13:14:05 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Fri Sep 27 03:00:09 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (lookup_name_real): Don't try to look up anything in a
- TYPENAME_TYPE.
+ TYPENAME_TYPE.
* tinfo2.cc (__throw_type_match_rtti): Oops.
@@ -1027,7 +1120,7 @@ Thu Sep 26 22:11:05 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Thu Sep 26 10:59:00 1996 Jason Merrill <jason@yorick.cygnus.com>
* rtti.c (build_dynamic_cast): Pass tinfo fns rather than
- calling them.
+ calling them.
(get_tinfo_fn_dynamic): Extracted from build_typeid.
* tinfo2.cc (__dynamic_cast): Adjust.
@@ -1070,11 +1163,11 @@ Tue Sep 24 18:18:44 1996 Jason Merrill <jason@yorick.cygnus.com>
for cv-quals.
* Remove .h from standard C++ headers, add new.h, move into inc
- subdirectory.
+ subdirectory.
* exception*: Remove pointer from object, constructors. Add
- default exception::what that uses type_info::name. Add
- __throw_bad_typeid.
+ default exception::what that uses type_info::name. Add
+ __throw_bad_typeid.
* init.c (build_new): Don't add a cookie to new (void *) T[2].
@@ -1105,7 +1198,7 @@ Mon Sep 23 01:18:50 1996 Jason Merrill <jason@yorick.cygnus.com>
Sun Sep 22 05:31:22 1996 Jason Merrill <jason@yorick.cygnus.com>
* lex.c (do_identifier): Don't do deferred lookup in a template
- header.
+ header.
* typeck2.c (store_init_value): Oops.
@@ -1129,7 +1222,7 @@ Sat Sep 21 19:17:28 1996 Jason Merrill <jason@yorick.cygnus.com>
Thu Sep 19 16:41:07 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (begin_template_parm_list): Increment
- processing_template_decl here.
+ processing_template_decl here.
(end_template_parm_list): Not here.
(process_template_parm): No need to add 1 to it now.
* *.c: Use processing_template_decl instead of current_template_parms
@@ -1148,7 +1241,7 @@ Wed Sep 18 13:30:20 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Wed Sep 18 04:24:07 1996 Jason Merrill <jason@yorick.cygnus.com>
* method.c (make_thunk): Call comdat_linkage before setting the
- TREE_CODE.
+ TREE_CODE.
* decl2.c (comdat_linkage): Use make_decl_one_only.
(import_export_decl): Likewise.
@@ -1160,19 +1253,19 @@ Sat Sep 14 08:34:41 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (grokfield): Tighten checking for access decls.
* decl.c (make_typename_type): Resolve references to
- current_class_type. Set CLASSTYPE_GOT_SEMICOLON.
+ current_class_type. Set CLASSTYPE_GOT_SEMICOLON.
(lookup_name_real): Types that depend on a template parameter get
- an implicit 'typename' unless they're in the current scope.
+ an implicit 'typename' unless they're in the current scope.
(start_decl_1): We don't care about incomplete types that depend
- on a template parm.
+ on a template parm.
(grokdeclarator): Resolve 'typename's in the type specifier that
- refer to members of the current scope.
+ refer to members of the current scope.
* call.c (build_over_call): Remove 'inline called before
- definition' diagnostic.
+ definition' diagnostic.
(build_method_call): Likewise.
* decl.c (duplicate_decls): Downgrade 'used before declared
- inline' to a warning, only with -Winline.
+ inline' to a warning, only with -Winline.
Fri Sep 13 17:31:40 1996 Stan Shebs <shebs@andros.cygnus.com>
@@ -1191,7 +1284,7 @@ Wed Sep 11 22:14:44 1996 Mike Stump <mrs@cygnus.com>
Wed Sep 11 22:10:48 1996 Mike Stump <mrs@cygnus.com>
* except.c (expand_start_catch_block): Add a pushlevel so that -g
- works on hppa and SPARC.
+ works on hppa and SPARC.
Wed Sep 11 10:18:06 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -1221,7 +1314,7 @@ Sun Sep 8 16:06:57 1996 Gerald Baumgartner <gb@cs.purdue.edu>
Thu Sep 5 16:51:28 1996 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (build_c_cast): Don't tack a non_lvalue_expr onto a
- target_expr.
+ target_expr.
Thu Sep 5 10:05:38 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -1239,18 +1332,18 @@ Wed Sep 4 17:16:09 1996 Bob Manson <manson@charmed.cygnus.com>
Wed Sep 4 12:14:36 1996 Mike Stump <mrs@cygnus.com>
* except.c (expand_exception_blocks): Always make sure USE and
- CLOBBER insns that came at the end still do, the backend relies
- upon this.
+ CLOBBER insns that came at the end still do, the backend relies
+ upon this.
Wed Sep 4 07:44:48 1996 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_over_call): We can only use a TARGET_EXPR of the
- right type.
+ right type.
Tue Sep 3 19:26:05 1996 Jason Merrill <jason@yorick.cygnus.com>
* cvt.c (convert_to_reference): Revert last change, don't complain
- about temp without target decl.
+ about temp without target decl.
Tue Sep 3 10:22:56 1996 Mike Stump <mrs@cygnus.com>
@@ -1263,15 +1356,15 @@ Tue Sep 3 02:38:56 1996 Jason Merrill <jason@yorick.cygnus.com>
Fri Aug 30 14:26:57 1996 Mike Stump <mrs@cygnus.com>
* pt.c (tsubst): And support template args inside the exception
- specification.
+ specification.
* pt.c (tsubst): Add support for exception specifications in
- template functions.
+ template functions.
Fri Aug 30 10:01:55 1996 Mike Stump <mrs@cygnus.com>
* cp-tree.def (DECL_STMT): Eliminate the throw spec field, only 3
- fields now.
+ fields now.
* cp-tree.h (start_decl): Eliminate the throw spec parameter.
(start_function): Likewise.
(start_method): Likewise.
@@ -1281,30 +1374,30 @@ Fri Aug 30 10:01:55 1996 Mike Stump <mrs@cygnus.com>
* lex.c (set_quals_and_spec): Likewise.
* decl.h (grokdeclarator): Eliminate the throw spec parameter.
* decl.c (shadow_tag): Eliminate the throw spec parameter to
- grokdeclarator.
+ grokdeclarator.
(groktypename): Likewise.
(start_decl): Eliminate the throw spec parameter. Eliminate the
- throw spec parameter to grokdeclarator. Eliminate the throw spec
- field in DECL_STMT.
+ throw spec parameter to grokdeclarator. Eliminate the throw spec
+ field in DECL_STMT.
(cp_finish_decl): Eliminate the throw spec field in DECL_STMT.
(grokfndecl): Remove useless set of raises.
(grokdeclarator): Eliminate the throw spec parameter. Eliminate
- the throw spec parameter to start_decl. Pull the throw spec out
- of the call declarator.
+ the throw spec parameter to start_decl. Pull the throw spec out
+ of the call declarator.
(grokparms): Eliminate the throw spec parameter to grokdeclarator.
(start_function): Eliminate the throw spec parameter. Eliminate
- the throw spec parameter to grokdeclarator.
+ the throw spec parameter to grokdeclarator.
(start_method): Likewise.
* decl2.c (grokfield): Likewise.
(grokbitfield): Eliminate the throw spec parameter to grokdeclarator.
(grokoptypename): Likewise.
(finish_file): Eliminate the throw spec parameter to
- start_function. Add throw spec to make_call_declarator.
+ start_function. Add throw spec to make_call_declarator.
* except.c (init_exception_processing): Add throw spec to
- make_call_declarator. Eliminate the throw spec parameter to
- start_decl.
+ make_call_declarator. Eliminate the throw spec parameter to
+ start_decl.
(expand_start_catch_block): Eliminate the throw spec parameter to
- grokdeclarator.
+ grokdeclarator.
(expand_builtin_throw): Add throw spec to make_call_declarator.
Eliminate the throw spec parameter to start_function.
(start_anon_func): Likewise.
@@ -1313,20 +1406,20 @@ Fri Aug 30 10:01:55 1996 Mike Stump <mrs@cygnus.com>
(cons_up_default_function): Add throw spec to make_call_declarator.
Eliminate the throw spec parameter to grokfield.
* method.c (synthesize_method): Eliminate the throw spec parameter
- to start_function.
+ to start_function.
* pt.c (process_template_parm): Eliminate the throw spec parameter
- to grokdeclarator.
+ to grokdeclarator.
(tsubst): Add throw spec to make_call_declarator.
(tsubst_expr): Eliminate the throw spec parameter to start_decl.
(do_function_instantiation): Eliminate the throw spec parameter to
- grokdeclarator. Eliminate the throw spec parameter to
- start_function.
+ grokdeclarator. Eliminate the throw spec parameter to
+ start_function.
* rtti.c (synthesize_tinfo_fn): Eliminate the throw spec parameter
- to start_function.
+ to start_function.
* parse.y (datadef): Remove non-winning optimization.
(decl): Likewise.
(fndef): Remove ambiguous error productions uncovered by grammer
- fixing.
+ fixing.
(constructor_declarator): Add exception_specification_opt here.
(component_constructor_declarator): Likewise.
(direct_after_type_declarator): Likewise.
@@ -1348,10 +1441,10 @@ Fri Aug 30 10:01:55 1996 Mike Stump <mrs@cygnus.com>
Wed Aug 28 01:40:30 1996 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_over_call): Also use an INIT_EXPR when
- initializing anything from an rvalue.
+ initializing anything from an rvalue.
* call.c (build_over_call): Call stabilize_reference when building
- an INIT_EXPR instead of calling the copy ctor.
+ an INIT_EXPR instead of calling the copy ctor.
* call.c (joust): Extend the previous change to all comparisons.
@@ -1363,10 +1456,10 @@ Wed Aug 28 01:40:30 1996 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (build_static_cast): Implement.
* tree.c (build_cplus_new): Handle getting a TARGET_EXPR.
* decl.c (grokparms): Use can_convert_arg instead of
- implicit_conversion directly.
+ implicit_conversion directly.
(copy_args_p): New fn.
* cvt.c (convert_to_reference): Don't complain about temp with
- static_cast.
+ static_cast.
(build_up_reference): Handle TARGET_EXPRs.
* call.c (build_over_call): Elide unnecessary temps.
(can_convert*): Use new overloading code.
@@ -1378,7 +1471,7 @@ Tue Aug 27 13:12:21 1996 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (build_reinterpret_cast): Implement.
* call.c (add_builtin_candidate): Use TYPE_PTROB_P instead of
- ptr_complete_ob.
+ ptr_complete_ob.
(joust): If we're comparing a function to a builtin and the worst
conversion for the builtin is worse than the worst conversion for the
function, take the function.
@@ -1390,8 +1483,8 @@ Tue Aug 27 13:12:21 1996 Jason Merrill <jason@yorick.cygnus.com>
Tue Aug 27 13:14:58 1996 Bob Manson <manson@charmed.cygnus.com>
* rtti.c (build_dynamic_cast): Don't try to dereference exprtype
- too early. Make sure we explode if exprtype turns out to be a
- NULL_TREE when it shouldn't be.
+ too early. Make sure we explode if exprtype turns out to be a
+ NULL_TREE when it shouldn't be.
Tue Aug 27 10:56:21 1996 Mike Stump <mrs@cygnus.com>
@@ -1418,13 +1511,13 @@ Mon Aug 26 17:00:33 1996 Mike Stump <mrs@cygnus.com>
* hash.h: Rebuild.
* lex.c (make_pointer_declarator): Change type_quals into
- cv_qualifiers.
+ cv_qualifiers.
(make_reference_declarator): Likewise.
Thu Aug 22 01:09:22 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (start_function): Only check interface_* for templates
- with flag_alt_external_templates.
+ with flag_alt_external_templates.
* call.c (build_new_op): Check for comparison of different enum types.
(build_over_call): Fix arg # output.
@@ -1440,7 +1533,7 @@ Wed Aug 21 00:13:15 1996 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (error_type): Dont print reference-to-array.
* typeck.c (convert_for_assignment): Don't say contravariance for
- removing const.
+ removing const.
Tue Aug 20 13:23:00 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1457,7 +1550,7 @@ Tue Aug 20 13:23:00 1996 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_new_method_call): Check for erroneous args.
* pt.c (instantiate_class_template): Propagate
- TYPE_USES_MULTIPLE_INHERITANCE.
+ TYPE_USES_MULTIPLE_INHERITANCE.
Tue Aug 20 13:09:57 1996 Mike Stump <mrs@cygnus.com>
@@ -1517,12 +1610,12 @@ Thu Aug 15 17:27:13 1996 Jason Merrill <jason@yorick.cygnus.com>
Thu Aug 15 17:09:54 1996 Mike Stump <mrs@cygnus.com>
* except.c (do_unwind): Mark %i7 as used on the SPARC so we can
- optimize.
+ optimize.
Thu Aug 15 01:36:49 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (import_export_decl): Ignore #pragma interface for tinfo
- fns of classes without virtual functions.
+ fns of classes without virtual functions.
* call.c (add_function_candidate): Handle `this' specially.
(compare_ics): Likewise.
@@ -1557,7 +1650,7 @@ Sun Aug 11 15:20:58 1996 Jason Merrill <jason@yorick.cygnus.com>
(shadow_tag): Call push_template_decl for partial specializations.
* parse.y: Likewise.
* cp-tree.h (DECL_TEMPLATE_SPECIALIZATIONS): Replaces
- DECL_TEMPLATE_MEMBERS.
+ DECL_TEMPLATE_MEMBERS.
* call.c (print_z_candidates): Reduce duplication.
Fri Aug 9 14:36:08 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1580,12 +1673,12 @@ Thu Aug 8 17:04:18 1996 Jason Merrill <jason@yorick.cygnus.com>
(build_over_call): Or here.
* typeck.c (build_function_call_real): Or here.
* tree.c (bot_manip): Call mark_used on functions used in default
- args.
+ args.
Thu Aug 8 17:48:16 1996 Michael Meissner <meissner@tiktok.cygnus.com>
* decl2.c (import_export_vtable): Delete code that disabled vtable
- heuristic on systems with ASM_OUTPUT_EXTERNAL.
+ heuristic on systems with ASM_OUTPUT_EXTERNAL.
Wed Aug 7 12:44:11 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1593,16 +1686,16 @@ Wed Aug 7 12:44:11 1996 Jason Merrill <jason@yorick.cygnus.com>
better.
* decl.c (finish_function): Set the DECL_CONTEXT of the result to
- the function, not its outer block.
+ the function, not its outer block.
* call.c (build_field_call): Pass fields on to build_opfncall
- regardless of TYPE_OVERLOADS_CALL_EXPR.
+ regardless of TYPE_OVERLOADS_CALL_EXPR.
(build_method_call): Pass on to build_new_method_call sooner.
* typeck.c (build_ptrmemfunc): Just return what instantiate_type
gives us.
* class.c (instantiate_type): Don't put a POINTER_TYPE to
- METHOD_TYPE on an expression. Also make a copy of rhs instead of
+ METHOD_TYPE on an expression. Also make a copy of rhs instead of
modifying it.
Tue Aug 6 12:58:46 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1635,8 +1728,8 @@ Mon Aug 5 17:17:06 1996 Jason Merrill <jason@yorick.cygnus.com>
Mon Aug 5 17:07:47 1996 Mike Stump <mrs@cygnus.com>
* method.c (build_overload_name): Put bug fix into code but leave
- disabled for now so we can be bug compatible with older releases
- that do repeats incorrectly. In the future, we can enable it.
+ disabled for now so we can be bug compatible with older releases
+ that do repeats incorrectly. In the future, we can enable it.
Mon Aug 5 13:46:28 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1656,7 +1749,7 @@ Sun Aug 4 15:29:11 1996 Jason Merrill <jason@yorick.cygnus.com>
* cvt.c (build_up_reference): Propagate INDIRECT_BIND to
recursive calls.
* typeck.c (complete_type): Propagate
- TYPE_NEEDS_{CONSTRUCTING,DESTRUCTOR}.
+ TYPE_NEEDS_{CONSTRUCTING,DESTRUCTOR}.
Sat Aug 3 14:05:07 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1695,7 +1788,7 @@ Fri Aug 2 01:26:59 1996 Jason Merrill <jason@yorick.cygnus.com>
* hash.h: Regenerate.
* lex.h: Add RID_NULL.
* lex.c (init_lex): Create null_pointer_node here, stick it in
- RID_NULL.
+ RID_NULL.
* decl.c (init_decl_processing): Still set its type here.
* cvt.c (cp_convert_to_pointer): Don't produce null_pointer_node.
(convert_to_pointer_force): Likewise.
@@ -1714,14 +1807,14 @@ Fri Aug 2 01:26:59 1996 Jason Merrill <jason@yorick.cygnus.com>
(build_over_call): Here.
* cvt.c (build_new_method_call): Don't complain about no match if
- LOOKUP_SPECULATIVELY.
+ LOOKUP_SPECULATIVELY.
(build_over_call): Fix 'this' for virtual fn.
(build_new_method_call): Add diagnostic.
Thu Aug 1 16:45:09 1996 Jason Merrill <jason@yorick.cygnus.com>
* cvt.c (add_function_candidate): Expect 'this' and 'in_chrg' for
- constructors to be passed in.
+ constructors to be passed in.
(build_over_call): Likewise.
(build_user_type_conversion_1): Pass them in.
(convert_like): Likewise.
@@ -1735,13 +1828,13 @@ Thu Aug 1 16:45:09 1996 Jason Merrill <jason@yorick.cygnus.com>
Thu Aug 1 16:06:14 1996 Mike Stump <mrs@cygnus.com>
* lex.c (do_identifier): Don't use %O on IDENTIFIER_OPNAME_Ps, use
- %D instead.
+ %D instead.
Thu Aug 1 15:24:02 1996 Mike Stump <mrs@cygnus.com>
* except.c (expand_throw): Use maybe_build_cleanup_and_delete
- instead of just maybe_build_cleanup so that we deallocate the
- thrown object.
+ instead of just maybe_build_cleanup so that we deallocate the
+ thrown object.
Thu Aug 1 15:18:00 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -1751,23 +1844,23 @@ Thu Aug 1 15:18:00 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Thu Aug 1 11:53:51 1996 Bob Manson <manson@charmed.cygnus.com>
* pt.c (instantiate_class_template): Call complete_type. Also, if
- we're at the end of the file and we just instantiated a template
- class with a vtable, call finish_prevtable_vardecl.
+ we're at the end of the file and we just instantiated a template
+ class with a vtable, call finish_prevtable_vardecl.
* error.c (dump_decl): Don't explode (or explode more gracefully
- as appropriate) if the object being dumped has a null type.
+ as appropriate) if the object being dumped has a null type.
(dump_expr): Likewise.
* search.c (build_mi_matrix): Ensure that mi_size is large enough,
- by counting the number of nodes that we'll need before allocating
- the array.
+ by counting the number of nodes that we'll need before allocating
+ the array.
(lookup_fnfields): Fix comment.
(breadth_first_search): Fix comment.
Wed Jul 31 09:57:05 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_class_template): Propagate TYPE_PACKED and
- TYPE_ALIGN.
+ TYPE_ALIGN.
* class.c (finish_struct): Call cplus_decl_attributes here.
(finish_struct_1): Not here.
* cp-tree.h: Adjust.
@@ -1787,10 +1880,10 @@ Tue Jul 30 13:06:13 1996 Jason Merrill <jason@yorick.cygnus.com>
(build_over_call): Call require_complete_type.
* decl.c (start_function): Statics are static even in a #pragma
- interface file.
+ interface file.
* decl2.c (import_export_vtable): Disable vtable heuristic on
- systems with ASM_OUTPUT_EXTERNAL.
+ systems with ASM_OUTPUT_EXTERNAL.
* cvt.c (compare_ics): Fix comparison of PMEM_CONV and BASE_CONV.
(standard_conversion): No std conv to enum type.
@@ -1799,7 +1892,7 @@ Tue Jul 30 13:06:13 1996 Jason Merrill <jason@yorick.cygnus.com>
for ptm's.
* cvt.c (reference_binding): Bind directly to a base subobject of
- a class rvalue.
+ a class rvalue.
* cvt.c (build_new_op): Enforce access control.
@@ -1815,18 +1908,18 @@ Tue Jul 30 09:22:53 1996 Bob Manson <manson@charmed.cygnus.com>
Mon Jul 29 15:48:30 1996 Jason Merrill <jason@yorick.cygnus.com>
* cvt.c (build_builtin_candidate): Stick a dummy conversion in if
- it failed.
+ it failed.
* cvt.c (build_user_type_conversion_1): Handle overloaded
- conversion ops.
+ conversion ops.
* cvt.c (add_builtin_candidates): Don't consider type conversion
- operators for the first parameter of operator=.
+ operators for the first parameter of operator=.
Mon Jul 29 15:33:55 1996 Bob Manson <manson@charmed.cygnus.com>
* typeck.c (complete_type): Only call layout_type if we're not
- expanding a template.
+ expanding a template.
Mon Jul 29 14:40:38 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1847,7 +1940,7 @@ Mon Jul 29 14:40:38 1996 Jason Merrill <jason@yorick.cygnus.com>
Mon Jul 29 12:05:40 1996 Bob Manson <manson@charmed.cygnus.com>
* typeck.c (build_modify_expr): Always attempt to build a call to
- the assignment operator, even if we're using a default one.
+ the assignment operator, even if we're using a default one.
(convert_for_initialization): Call complete_type.
Mon Jul 29 11:25:08 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1882,16 +1975,16 @@ Fri Jul 26 01:07:22 1996 Jason Merrill <jason@yorick.cygnus.com>
Thu Jul 25 09:33:33 1996 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (complete_type): Call layout_type rather than building
- a new array type.
+ a new array type.
* cvt.c (add_builtin_candidate): Pointer arithmetic candidates
- only use ptrdiff_t.
+ only use ptrdiff_t.
Wed Jul 24 12:45:08 1996 Jason Merrill <jason@yorick.cygnus.com>
* cvt.c: Always compile the new overloading code (but don't use it).
(implicit_conversion): Add a BASE_CONV when converting to
- the same class type.
+ the same class type.
(convert_like): Handle BASE_CONV.
Tue Jul 23 12:46:30 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -1901,7 +1994,7 @@ Tue Jul 23 12:46:30 1996 Jason Merrill <jason@yorick.cygnus.com>
NEW_OVER changes:
* typeck.c (build_x_function_call): Try an operator function
- whenever we call an object of class type.
+ whenever we call an object of class type.
* method.c (build_opfncall): Pass CALL_EXPRs through.
* cvt.c (implicit_conversion): Do const-ref case first.
(add_conv_candidate, build_object_call, op_error): New fns.
@@ -1931,7 +2024,7 @@ Mon Jul 22 12:18:54 1996 Jason Merrill <jason@yorick.cygnus.com>
NEW_OVER changes:
* cvt.c (convert_to_reference): Don't use convert_from_refeence on
- result of build_type_conversion.
+ result of build_type_conversion.
(cp_convert): Only call build_method_call for ctors if
build_type_conversion failed.
(ptr_complete_ob): New function.
@@ -2005,20 +2098,20 @@ Wed Jul 10 19:36:37 1996 Mike Stump <mrs@cygnus.com>
Wed Jul 10 18:20:11 1996 Bob Manson <manson@charmed.cygnus.com>
* decl.c (grokdeclarator): Check for overflow when evaluating an
- array dimension.
+ array dimension.
Wed Jul 10 17:26:19 1996 Jason Merrill <jason@yorick.cygnus.com>
* cvt.c (cp_convert): Don't check for ambiguity with constructor
- if NEW_OVER.
+ if NEW_OVER.
* typeck.c (build_x_function_call): Pass function overload
- questions to new overloading code if NEW_OVER.
+ questions to new overloading code if NEW_OVER.
* init.c (expand_aggr_init_1): Only check for type conversion ops
- if we're doing copy-initialization (i.e. LOOKUP_ONLYCONVERTING).
- Don't check for ambiguity with constructor if NEW_OVER.
+ if we're doing copy-initialization (i.e. LOOKUP_ONLYCONVERTING).
+ Don't check for ambiguity with constructor if NEW_OVER.
* cvt.c (convert_to_reference): Dereference the result of a type
- conversion operator.
+ conversion operator.
(build_conv): Propagate ICS_USER_FLAG.
(implicit_conversion): Call instantiate_type.
Pass LOOKUP_ONLYCONVERTING instead of LOOKUP_NORMAL.
@@ -2039,7 +2132,7 @@ Wed Jul 10 17:26:19 1996 Jason Merrill <jason@yorick.cygnus.com>
Tue Jul 9 17:48:48 1996 Mike Stump <mrs@cygnus.com>
* decl.c (lookup_name_real): If we find mem in obj when parsing
- `obj->mem', make sure we return the right value.
+ `obj->mem', make sure we return the right value.
Tue Jul 9 16:11:28 1996 Bob Manson <manson@charmed.cygnus.com>
@@ -2052,7 +2145,7 @@ Tue Jul 9 12:46:34 1996 Mike Stump <mrs@cygnus.com>
Mon Jul 8 16:42:31 1996 Jason Merrill <jason@yorick.cygnus.com>
* init.c (expand_aggr_init_1): Don't check type conversions if
- NEW_OVER.
+ NEW_OVER.
* cvt.c (z_candidate): Put back template field.
(add_function_candidate): Set it.
@@ -2068,7 +2161,7 @@ Mon Jul 8 16:18:56 1996 Bob Manson <manson@charmed.cygnus.com>
* call.c (compute_conversion_costs): Call complete_type.
* tree.c (vec_binfo_member): Use comptypes instead of comparing
- pointers, so we can handle template parameters.
+ pointers, so we can handle template parameters.
Fri Jul 5 16:51:53 1996 Bob Manson <manson@charmed.cygnus.com>
@@ -2095,7 +2188,7 @@ Mon Jul 1 22:58:18 1996 Bob Manson <manson@charmed.cygnus.com>
* decl.c: Add signed_size_zero_node.
(init_decl_processing): Build it.
* class.c (prepare_fresh_vtable): Use it instead of size_zero_node
- when we're trying to make a negative delta.
+ when we're trying to make a negative delta.
Mon Jul 1 17:56:19 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -2119,9 +2212,9 @@ Mon Jul 1 17:56:19 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Sat Jun 29 14:05:46 1996 Jason Merrill <jason@yorick.cygnus.com>
* cvt.c (cp_convert_to_pointer): Move user-defined type conversion
- handling to before extraction of TYPE_PTRMEMFUNC_FN_TYPE.
+ handling to before extraction of TYPE_PTRMEMFUNC_FN_TYPE.
(convert_to_reference): Use build_type_conversion to convert to
- the reference type directly.
+ the reference type directly.
(standard_conversion): Fix void* case, non-conversions.
(reference_binding): Fix expr == 0 case, non-conversions.
(convert_like): Support REF_BIND.
@@ -2140,7 +2233,7 @@ Thu Jun 27 15:18:30 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_class_template): Call repo_template_used.
* search.c (lookup_conversions): Only lookup conversions in
- complete types.
+ complete types.
Thu Jun 27 12:59:53 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -2156,7 +2249,7 @@ Wed Jun 26 18:29:47 1996 Bob Manson <manson@charmed.cygnus.com>
Mon Jun 24 17:17:32 1996 Mike Stump <mrs@cygnus.com>
* except.c (start_anon_func): Make sure anonymous functions are
- never external.
+ never external.
Fri Jun 21 15:10:58 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -2175,8 +2268,8 @@ Thu Jun 20 23:35:38 1996 Jason Merrill <jason@yorick.cygnus.com>
Thu Jun 20 14:08:40 1996 Bob Manson <manson@charmed.cygnus.com>
* decl2.c (grokbitfield): Handle constant decls appropriately.
- Give an appropriate error message now instead of spewing core
- later.
+ Give an appropriate error message now instead of spewing core
+ later.
Thu Jun 20 13:01:51 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -2190,7 +2283,7 @@ Wed Jun 19 11:37:04 1996 Jason Merrill <jason@yorick.cygnus.com>
Tue Jun 18 10:02:15 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_decl): If at_eof, call import_export_decl
- regardless of DECL_INLINE.
+ regardless of DECL_INLINE.
* typeck.c (mark_addressable): Set TREE_ADDRESSABLE on CONSTRUCTORs.
@@ -2212,7 +2305,7 @@ Mon Jun 17 15:23:36 1996 Jason Merrill <jason@yorick.cygnus.com>
Sun Jun 16 12:33:57 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (finish_vtable_vardecl): Don't trust
- TREE_SYMBOL_REFERENCED for vtables of local classes.
+ TREE_SYMBOL_REFERENCED for vtables of local classes.
Fri Jun 14 18:13:36 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -2231,7 +2324,7 @@ Tue Jun 11 15:09:18 1996 Bob Manson <manson@charmed.cygnus.com>
Tue Jun 11 13:56:23 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (import_export_decl): Still emit static/weak/comdat
- copies of inline template functions with -fno-implicit-templates.
+ copies of inline template functions with -fno-implicit-templates.
Tue Jun 11 11:42:13 1996 Bob Manson <manson@charmed.cygnus.com>
@@ -2241,33 +2334,33 @@ Tue Jun 11 11:42:13 1996 Bob Manson <manson@charmed.cygnus.com>
Fri Jun 7 15:30:10 1996 Bob Manson <manson@charmed.cygnus.com>
* decl.c (build_enumerator): Always copy the INTEGER_CST used to
- initialize the enum, because we really and truly don't know where
- it came from.
+ initialize the enum, because we really and truly don't know where
+ it came from.
(start_enum): Don't copy integer_zero_node because
- build_enumerator will do it.
+ build_enumerator will do it.
Fri Jun 7 11:11:09 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (finish_function): Do access control on base destructors.
* pt.c (tsubst, case FUNCTION_DECL): Set up
- IDENTIFIER_GLOBAL_VALUE for member functions so pushdecl doesn't
- hose us.
+ IDENTIFIER_GLOBAL_VALUE for member functions so pushdecl doesn't
+ hose us.
Fri Jun 7 10:37:33 1996 Mike Stump <mrs@cygnus.com>
* cvt.c (build_up_reference): If we have already extended the
- lifetime of the temporary, don't try it again.
+ lifetime of the temporary, don't try it again.
* typeck.c (c_expand_return): Don't try and convert the return
value twice when we want a reference, once is enough.
Tue Jun 4 15:41:45 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (tsubst_expr, case DECL_STMT): Don't pass
- LOOKUP_ONLYCONVERTING at all for now.
+ LOOKUP_ONLYCONVERTING at all for now.
* search.c (add_conversions): Put the conversion function in
- TREE_VALUE, the basetype in TREE_PURPOSE.
+ TREE_VALUE, the basetype in TREE_PURPOSE.
* cvt.c (build_type_conversion): Adjust.
* cvt.c (build_expr_type_conversion): Adjust.
* call.c (user_harshness): Adjust.
@@ -2275,7 +2368,7 @@ Tue Jun 4 15:41:45 1996 Jason Merrill <jason@yorick.cygnus.com>
Mon Jun 3 15:30:52 1996 Jason Merrill <jason@yorick.cygnus.com>
* method.c (emit_thunk): Pretend this is a FUNCTION_DECL for the
- backend's benefit.
+ backend's benefit.
Mon Jun 10 18:58:19 1996 Mike Stump <mrs@cygnus.com>
@@ -2294,7 +2387,7 @@ Fri May 31 14:56:13 1996 Mike Stump <mrs@cygnus.com>
Fri May 31 14:22:08 1996 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (build_modify_expr): Don't use TREE_VALUE on a
- TARGET_EXPR.
+ TARGET_EXPR.
Wed May 29 17:04:33 1996 Mike Stump <mrs@cygnus.com>
@@ -2324,27 +2417,27 @@ Thu May 23 16:40:30 1996 Jason Merrill <jason@yorick.cygnus.com>
TYPE_HAS_ASSIGN_REF (basetype).
* decl.c (grokfndecl): Diagnose user definition of
- implicitly-declared methods.
+ implicitly-declared methods.
Thu May 23 12:13:08 1996 Bob Manson <manson@charmed.cygnus.com>
* method.c (do_build_copy_constructor): Add code to give
- meaningful error messages instead of crashing.
- (do_build_assign_ref): Don't synthesize assignment operators for
- classes containing reference or const members.
+ meaningful error messages instead of crashing.
+ (do_build_assign_ref): Don't synthesize assignment operators for
+ classes containing reference or const members.
* class.c (struct base_info): Remove cant_synth_copy_ctor
and cant_synth_asn_ref.
(finish_base_struct): Remove the code that tries to conditionalize
- synthesis of copy constructors & assignment operators based on
- access permissions. Instead, let it fail when it tries to
- synthesize the copy constructor. This will give meaningful error
- messages instead of silently generating code to perform a bitcopy.
+ synthesis of copy constructors & assignment operators based on
+ access permissions. Instead, let it fail when it tries to
+ synthesize the copy constructor. This will give meaningful error
+ messages instead of silently generating code to perform a bitcopy.
Wed May 22 11:45:19 1996 Bob Manson <manson@charmed.cygnus.com>
* lex.c (real_yylex): Remove old-n-crufty #if 0 code for
- determining types for constant values.
+ determining types for constant values.
* decl.c (struct named_label_list): Use instead of stuffing
random items into a TREE_LIST node.
@@ -2352,8 +2445,8 @@ Wed May 22 11:45:19 1996 Bob Manson <manson@charmed.cygnus.com>
(poplevel): Likewise.
(lookup_label): Likewise.
(define_label): Add an error message to tell the user the line
- where the goto is located in addition to the destination of the
- goto.
+ where the goto is located in addition to the destination of the
+ goto.
(init_decl_processing): Use NULL instead of NULL_TREE to initialize
named_label_uses.
(finish_function): Likewise.
@@ -2368,22 +2461,22 @@ Wed May 22 09:33:23 1996 Jason Merrill <jason@yorick.cygnus.com>
Tue May 21 11:21:56 1996 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_method_call): Always convert 'this' to the
- appropriate type.
+ appropriate type.
* search.c (add_conversions): Put the conversion function in
- TREE_VALUE, the type in TREE_PURPOSE.
+ TREE_VALUE, the type in TREE_PURPOSE.
* cvt.c (build_type_conversion): Adjust.
* call.c (user_harshness): Adjust.
* method.c (emit_thunk): Call temporary_allocation and
- permanent_allocation around the ASM_OUTPUT_MI_THUNK case, too.
+ permanent_allocation around the ASM_OUTPUT_MI_THUNK case, too.
* tree.c (build_cplus_array_type): Handle tweaking of
- TYPE_MAIN_VARIANT here.
+ TYPE_MAIN_VARIANT here.
* typeck.c (common_type): Not here.
* typeck.c (complete_type): Only try to complete an array type if
- it has a domain.
+ it has a domain.
Mon May 20 14:55:59 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -2393,7 +2486,7 @@ Mon May 20 14:55:59 1996 Jason Merrill <jason@yorick.cygnus.com>
Fri May 17 16:41:17 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_class_template): Re-set
- CLASSTYPE_GOT_SEMICOLON after calling finish_struct_1.
+ CLASSTYPE_GOT_SEMICOLON after calling finish_struct_1.
Fri May 17 14:56:55 1996 Mike Stump <mrs@cygnus.com>
@@ -2429,7 +2522,7 @@ Thu May 16 15:29:33 1996 Bob Manson <manson@charmed.cygnus.com>
Thu May 16 13:38:58 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_class_template): Remove obsolete check for
- access declarations.
+ access declarations.
Thu May 16 13:34:15 1996 Mike Stump <mrs@cygnus.com>
@@ -2516,7 +2609,7 @@ Fri May 10 11:09:57 1996 Jason Merrill <jason@yorick.cygnus.com>
* cvt.c (convert_fn_ptr): We don't use thunks for pmfs.
* method.c (emit_thunk): Set flag_omit_frame_pointer in default
- code.
+ code.
Thu May 9 18:18:30 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -2534,20 +2627,20 @@ Tue May 7 20:39:57 1996 Mike Stump <mrs@cygnus.com>
Mon May 6 01:23:32 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (finish_file): Don't try to emit functions that haven't
- been compiled.
+ been compiled.
Fri May 3 09:30:13 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (finish_vtable_vardecl): Oops.
* decl.c (maybe_push_to_top_level): Do save previous_class_*.
- Also store the bindings from previous_class_values.
+ Also store the bindings from previous_class_values.
(pop_from_top_level): Restore them.
Thu May 2 21:56:49 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (finish_vtable_vardecl): Only write out vtable if its
- symbol has been referenced.
+ symbol has been referenced.
(finish_file): Re-join synthesis/vtable loop with inline emission
loop, disable inlining when an inline is output.
@@ -2567,21 +2660,21 @@ Thu May 2 16:21:17 1996 Mike Stump <mrs@cygnus.com>
Thu May 2 11:26:41 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (maybe_push_to_top_level): Clear out class-level bindings
- cache.
+ cache.
Wed May 1 11:26:52 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (finish_file): Also use sentries for vars with
- DECL_ONE_ONLY or DECL_WEAK set (should any such happen to be
- created).
+ DECL_ONE_ONLY or DECL_WEAK set (should any such happen to be
+ created).
* lex.c (handle_cp_pragma): Disable #pragma
- interface/implementation if SUPPORTS_ONE_ONLY > 1.
+ interface/implementation if SUPPORTS_ONE_ONLY > 1.
Tue Apr 30 11:25:46 1996 Jason Merrill <jason@yorick.cygnus.com>
* method.c (emit_thunk): Wrap default case in
- temporary/permanent_allocation.
+ temporary/permanent_allocation.
* method.c (make_thunk): Use DECL_ONE_ONLY.
(emit_thunk): Call assemble_end_function.
@@ -2601,10 +2694,10 @@ Mon Apr 29 14:32:47 1996 Mike Stump <mrs@cygnus.com>
Mon Apr 29 00:27:53 1996 Jason Merrill <jason@yorick.cygnus.com>
* class.c (build_vtable_entry): Don't build thunks for abstract
- virtuals.
+ virtuals.
* lex.c (real_yylex): Fix handling of __PRETTY_FUNCTION__ like C
- frontend.
+ frontend.
Sat Apr 27 16:45:35 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -2637,7 +2730,7 @@ Wed Apr 24 15:41:15 1996 Bob Manson <manson@charmed.cygnus.com>
definition of flagged_type_tree is found before it is used.
* lex.c: Likewise.
* parse.y: Added the ftype member to the type union, and changed a
- number of rules to use it instead of ttype. Added calls to
+ number of rules to use it instead of ttype. Added calls to
check_for_new_type() as appropriate.
* typeck2.c (check_for_new_type): New function for checking
if a newly defined type appears in the specified tree.
@@ -2669,21 +2762,21 @@ Tue Apr 23 10:52:56 1996 Jason Merrill <jason@yorick.cygnus.com>
Mon Apr 22 17:28:27 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (import_export_decl): Put static data member templates
- into common storage, or make them weak, depending on whether they
- are dynamically or statically initialized.
+ into common storage, or make them weak, depending on whether they
+ are dynamically or statically initialized.
(get_sentry): New function.
(finish_file): Do import_export_decl for static data members before
building the init/fini functions. Don't init/fini a variable that's
EXTERNAL. Use a sentry for variables in common. Fix mismatching
push/pop_temp_slots.
* decl.c (cp_finish_decl): If DECL_NOT_REALLY_EXTERN, do the
- expand_static_init thang.
+ expand_static_init thang.
* method.c (get_id_2): New function.
Mon Apr 22 15:32:45 1996 Bob Manson <manson@charmed.cygnus.com>
* parse.y (empty_parms): Make sure we use C++-style prototypes
- when we're declaring member functions.
+ when we're declaring member functions.
Sun Apr 21 10:08:22 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -2693,12 +2786,12 @@ Sun Apr 21 10:08:22 1996 Jason Merrill <jason@yorick.cygnus.com>
Thu Apr 18 08:56:54 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (make_typename_type): Handle getting a TYPE_DECL for a
- name.
+ name.
* parse.y (base_class.1): Allow 'typename foo::bar'.
* lex.c (check_newline): Remove #pragma code that plays with the
- input stream, since we now deal with tokens. Clear nextchar when
- we're done.
+ input stream, since we now deal with tokens. Clear nextchar when
+ we're done.
(handle_cp_pragma): Use real_yylex.
(handle_sysv_pragma): Don't do skipline here. Only call real_yylex
in one place.
@@ -2719,16 +2812,16 @@ Wed Apr 17 16:51:33 1996 Jason Merrill <jason@yorick.cygnus.com>
Wed Apr 17 15:02:40 1996 Mike Stump <mrs@cygnus.com>
* typeck.c (build_reinterpret_cast): Handle pointer to member
- functions.
+ functions.
Wed Apr 17 12:28:26 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
* lex.c (handle_cp_pragma): New function, with decl, doing the cc1plus
- pragmas.
+ pragmas.
(check_newline): Put the vtable/unit/implementation/interface pragma
- code into handle_cp_pragma, replacing it with a call.
+ code into handle_cp_pragma, replacing it with a call.
(handle_sysv_pragma): Give int return type, and take FINPUT and TOKEN
- args. Get the next token after handling the pragma token.
+ args. Get the next token after handling the pragma token.
Wed Apr 17 10:28:34 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -2748,7 +2841,7 @@ Tue Apr 16 13:44:58 1996 Jason Merrill <jason@yorick.cygnus.com>
* tree.def: Add VEC_INIT_EXPR.
* expr.c (cplus_expand_expr): Handle it.
* init.c (build_new): Use it instead of the RTL_EXPR nastiness and
- the extra file-scope symbol nastiness.
+ the extra file-scope symbol nastiness.
Mon Apr 15 16:21:29 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -2766,9 +2859,9 @@ Sun Apr 14 11:34:39 1996 Jason Merrill <jason@yorick.cygnus.com>
Fri Apr 12 09:08:27 1996 Bob Manson <manson@charmed.cygnus.com>
* call.c (build_method_call): Remember the original basetype we
- were called with. Give an error message instead of trying
- (incorrectly) to call a non-static member function through a
- non-inherited class.
+ were called with. Give an error message instead of trying
+ (incorrectly) to call a non-static member function through a
+ non-inherited class.
* search.c (expand_upcast_fixups): Mark the new fixup as
DECL_ARTIFICIAL.
@@ -2845,23 +2938,23 @@ Tue Apr 9 14:20:57 1996 Mike Stump <mrs@cygnus.com>
Tue Apr 9 12:10:26 1996 Jason Merrill <jason@yorick.cygnus.com>
* rtti.c (build_dynamic_cast): Handle downcasting to X* given
- other X subobjects in the most derived type. Ack.
+ other X subobjects in the most derived type. Ack.
* rtti.c (build_dynamic_cast): No need to strip cv-quals here,
- get_typeid will do it for us.
+ get_typeid will do it for us.
(get_typeid_1): Break out call-building for expand_*_desc to use.
(get_typeid): Call it.
(expand_*_desc): Likewise.
* decl.c (init_decl_processing): Don't set TYPE_BUILT_IN on char *
- and void *.
+ and void *.
(init_decl_processing): Lose builtin_type_tdescs lossage.
* decl2.c (finish_vtable_vardecl): Remove obsolete code.
Mon Apr 8 17:23:23 1996 Bob Manson <manson@charmed.cygnus.com>
* pt.c (tsubst): When calling set_nested_typename, use
- TYPE_NESTED_NAME (current_class_type) instead of
- current_class_name.
+ TYPE_NESTED_NAME (current_class_type) instead of
+ current_class_name.
* decl.c (pushdecl): Likewise.
(pushdecl_class_level): Likewise.
@@ -2883,12 +2976,12 @@ Sat Apr 6 13:56:27 1996 Jason Merrill <jason@yorick.cygnus.com>
* rtti.c (synthesize_tinfo_fn): Handle enums and pmfs.
* decl2.c (finish_file): Don't synthesize artificial functions
- that are external and not inline.
+ that are external and not inline.
* rtti.c (get_tinfo_fn): If at_eof, call import_export_decl.
* decl2.c (finish_file): Handle having new inlines added to
- saved_inlines by synthesis.
+ saved_inlines by synthesis.
* rtti.c (get_bad_cast_node): Don't require <typeinfo>.
@@ -2920,17 +3013,17 @@ Fri Apr 5 17:02:09 1996 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h: Add decls.
* method.c (hack_identifier): Also convert component_refs from
- references.
+ references.
* lex.c (cons_up_default_function): Use the type, not the name, in
- declspecs.
+ declspecs.
* decl2.c (import_export_vtable): Fix weak vtables.
Fri Apr 5 13:30:17 1996 Bob Manson <manson@charmed.cygnus.com>
* search.c (get_base_distance_recursive): Fix access checks for
- protected bases.
+ protected bases.
Fri Apr 5 11:02:06 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -2999,13 +3092,13 @@ Fri Mar 29 15:51:36 1996 Bob Manson <manson@charmed.cygnus.com>
needs_virtual_dtor with base_has_virtual.
(finish_struct_1): Remove the old code that tried to make default
- destructors virtual. Use base_has_virtual when checking if we need
- to add a vtable entry for the rtti code.
+ destructors virtual. Use base_has_virtual when checking if we need
+ to add a vtable entry for the rtti code.
Fri Mar 29 14:02:36 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (push_template_decl): Complain about template decl with
- inappropriate declaration.
+ inappropriate declaration.
Fri Mar 29 12:15:35 1996 Bob Manson <manson@charmed.cygnus.com>
@@ -3027,7 +3120,7 @@ Thu Mar 28 16:41:39 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (shadow_tag): Fix error about anon union with methods.
* parse.y (self_reference): Only generate a self-reference if this
- is a non-template class.
+ is a non-template class.
(opt.component_decl_list): Only use it if it was generated.
* parse.y (component_decl_1): Use constructor_declarator.
@@ -3043,7 +3136,7 @@ Thu Mar 28 15:11:35 1996 Bob Manson <manson@charmed.cygnus.com>
Thu Mar 28 14:49:26 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (process_template_parm): Allow template type parms to be
- used as types for template const parms.
+ used as types for template const parms.
Wed Mar 27 15:51:19 1996 Mike Stump <mrs@cygnus.com>
@@ -3053,7 +3146,7 @@ Wed Mar 27 15:51:19 1996 Mike Stump <mrs@cygnus.com>
Wed Mar 27 10:14:30 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (lookup_name_real): Be even more picky about the
- ambiguous lookup warning.
+ ambiguous lookup warning.
(grokdeclarator): Tweak SCOPE_REF constructor declarators here.
* parse.y (constructor_declarator): Rather than here.
@@ -3075,7 +3168,7 @@ Tue Mar 26 13:41:33 1996 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h: Adjust.
* pt.c (do_function_instantiation): Separate handling of member
- functions and non-member functions properly.
+ functions and non-member functions properly.
Mon Mar 25 14:23:22 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -3098,7 +3191,7 @@ Mon Mar 25 13:30:42 1996 Bob Manson <manson@charmed.cygnus.com>
Mon Mar 25 13:07:19 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (cp_finish_decl): Don't build cleanups for static
- variables here.
+ variables here.
Fri Mar 22 17:57:55 1996 Mike Stump <mrs@cygnus.com>
@@ -3112,19 +3205,19 @@ Fri Mar 22 17:57:55 1996 Mike Stump <mrs@cygnus.com>
Fri Mar 22 13:48:29 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Call bad_specifiers for typedefs. Also
- give an error if initialized. Pedwarn about nested type with the
- same name as its enclosing class.
+ give an error if initialized. Pedwarn about nested type with the
+ same name as its enclosing class.
* pt.c (tsubst, case TYPE_DECL): Set DECL_CONTEXT.
* typeck.c (require_complete_type): Be sure to instantiate the
- MAIN_VARIANT of the type.
+ MAIN_VARIANT of the type.
* decl2.c (finish_file): Instantiate pending templates before
- processing static constructors and destructors.
+ processing static constructors and destructors.
* pt.c (instantiate_decl): Don't instantiate functions at toplevel
- unless at_eof.
+ unless at_eof.
Fri Mar 22 09:30:17 1996 Bob Manson <manson@beauty.cygnus.com>
@@ -3137,10 +3230,10 @@ Fri Mar 22 09:30:17 1996 Bob Manson <manson@beauty.cygnus.com>
Wed Mar 20 14:51:55 1996 Jason Merrill <jason@yorick.cygnus.com>
* parse.y (named_complex_class_head_sans_basetype): Don't crash on
- definition of nonexistent nested type.
+ definition of nonexistent nested type.
* error.c (dump_decl, case TYPE_DECL): Fix decision for whether or
- not to say 'typedef'.
+ not to say 'typedef'.
Wed Mar 20 00:11:47 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -3156,7 +3249,7 @@ Tue Mar 19 17:56:03 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (build_expr_from_tree): Likewise.
* pt.c (mangle_class_name_for_template): Always allocate
- scratch_firstobj.
+ scratch_firstobj.
Tue Mar 19 16:34:31 1996 Bob Manson <manson@beauty.cygnus.com>
@@ -3166,8 +3259,8 @@ Tue Mar 19 16:34:31 1996 Bob Manson <manson@beauty.cygnus.com>
Tue Mar 19 16:00:33 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_class_template): Don't bother setting up
- CLASSTYPE_TAGS explicitly, as the nested types will add
- themselves.
+ CLASSTYPE_TAGS explicitly, as the nested types will add
+ themselves.
Tue Mar 19 15:48:43 1996 Bob Manson <manson@beauty.cygnus.com>
@@ -3179,19 +3272,19 @@ Tue Mar 19 15:48:43 1996 Bob Manson <manson@beauty.cygnus.com>
Tue Mar 19 09:21:35 1996 Jason Merrill <jason@yorick.cygnus.com>
* lex.c (do_identifier): Only do name consistency check if we're
- parsing.
+ parsing.
* pt.c (push_template_decl): Don't crash if we get a member defn
that doesn't match.
* decl.c (xref_tag_from_type): New function to do an xref without
- always having to figure out code_type_node.
+ always having to figure out code_type_node.
* cp-tree.h: Declare it.
* pt.c (instantiate_class_template): Use it for friend classes.
- (lookup_template_class): Use it.
+ (lookup_template_class): Use it.
* typeck2.c (build_functional_cast): Pull out a single parm before
- passing it to build_c_cast.
+ passing it to build_c_cast.
Tue Mar 19 09:07:15 1996 Bob Manson <manson@beauty.cygnus.com>
@@ -3201,10 +3294,10 @@ Tue Mar 19 09:07:15 1996 Bob Manson <manson@beauty.cygnus.com>
Mon Mar 18 21:57:54 1996 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (build_c_cast): Don't pull single TEMPLATE_DECL out of
- an overload list.
+ an overload list.
* lex.c (cons_up_default_function): Really, now, interface hackery
- does not apply to synthesized methods.
+ does not apply to synthesized methods.
Mon Mar 18 18:20:57 1996 Mike Stump <mrs@cygnus.com>
@@ -3275,7 +3368,7 @@ Mon Mar 18 13:19:03 1996 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h: Update.
* tree.c (min_tree_cons): Call copy_to_permanent for the purpose
- and value.
+ and value.
Mon Mar 18 11:25:52 1996 Bob Manson <manson@beauty.cygnus.com>
@@ -3290,15 +3383,15 @@ Mon Mar 18 10:11:46 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Fri Mar 15 11:03:57 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_decl): Only call import_export_decl if at_eof
- and ! DECL_INLINE.
+ and ! DECL_INLINE.
* decl.c (finish_function): Don't set nested based on
- hack_decl_function_context.
+ hack_decl_function_context.
* parse.y (function_try_block): Check for nested function.
(pending_inlines): Likewise.
* decl2.c (build_expr_from_tree): If a unary op already has a
- type, just return it.
+ type, just return it.
* decl2.c (finish_prevtable_vardecl): Use ADJUST_VTABLE_LINKAGE.
@@ -3311,7 +3404,7 @@ Fri Mar 15 11:03:57 1996 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h: Adjust return types.
* class.c (delete_duplicate_fields_1): Don't complain about
- duplicate nested types if they're the same type.
+ duplicate nested types if they're the same type.
(finish_struct): Remove check for duplicate.
* decl2.c (grokfield): Don't check for typedef of anonymous type.
@@ -3320,20 +3413,20 @@ Thu Mar 14 10:00:19 1996 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h: Lose SIGNATURE_GROKKING_TYPEDEF.
* decl.c (grokdeclarator): Lose special handling of class-level
- typedef. Lose SIGNATURE_GROKKING_TYPEDEF. Set
- SIGNATURE_HAS_OPAQUE_TYPEDECLS later.
+ typedef. Lose SIGNATURE_GROKKING_TYPEDEF. Set
+ SIGNATURE_HAS_OPAQUE_TYPEDECLS later.
* cvt.c (convert_pointer_to_real): Retain cv-quals in conversion.
* pt.c (tsubst_copy): Strip cv-quals from destructor name types.
* search.c (compute_access): Fix handling of anonymous union
- members.
+ members.
* class.c (finish_struct_anon): Propagate TREE_{PRIVATE,PROTECTED}
- from anonymous unions to their members.
+ from anonymous unions to their members.
* typeck.c (build_x_function_call): For static member functions,
- hand off to build_member_call.
+ hand off to build_member_call.
Wed Mar 13 14:03:34 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -3347,14 +3440,14 @@ Tue Mar 12 14:36:02 1996 Jason Merrill <jason@yorick.cygnus.com>
(expand_vec_init): Handle lists, use convert_for_initialization
* typeck.c (convert_for_initialization): Pass LOOKUP_NO_CONVERSION
- when converting to an aggregate type.
+ when converting to an aggregate type.
* cvt.c (cp_convert): Pass it through.
* typeck.c (build_conditional_expr): Handle user-defined
- conversions to slightly different types.
+ conversions to slightly different types.
* decl.c (grokdeclarator): Force an array type in a parm to be
- permanent.
+ permanent.
* decl2.c (do_using_directive): Sorry.
(do_namespace_alias): Likewise.
@@ -3387,7 +3480,7 @@ Thu Mar 7 14:11:49 1996 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (cp_build_type_variant): Just return an error_mark_node.
* decl.c (make_typename_type): Don't try to get the file and line
- of an identifier.
+ of an identifier.
* typeck.c (comptypes): Handle TYPENAME_TYPE.
Wed Mar 6 18:47:50 1996 Per Bothner <bothner@kalessin.cygnus.com>
@@ -3398,7 +3491,7 @@ Wed Mar 6 18:47:50 1996 Per Bothner <bothner@kalessin.cygnus.com>
Wed Mar 6 09:57:36 1996 Jason Merrill <jason@yorick.cygnus.com>
* method.c (build_overload_value): Use DECL_ASSEMBLER_NAME in
- referring to addresses of variables and functions.
+ referring to addresses of variables and functions.
* error.c (dump_expr): Support SIZEOF_EXPR.
@@ -3407,12 +3500,12 @@ Wed Mar 6 09:57:36 1996 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (convert_arguments): Call complete_type.
* method.c (hack_identifier): After giving an error, set value to
- error_mark_node.
+ error_mark_node.
Tue Mar 5 16:00:15 1996 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (hack_decl_function_context): Kludge around DECL_CONTEXT
- lossage for local classes.
+ lossage for local classes.
* cp-tree.h: Declare it.
* decl.c (lookup_name_real): Evil, painful hack for local classes.
(grokfndecl): Set DECL_CLASS_CONTEXT and DECL_NO_STATIC_CHAIN here.
@@ -3424,7 +3517,7 @@ Tue Mar 5 16:00:15 1996 Jason Merrill <jason@yorick.cygnus.com>
* lex.c (process_next_inline): Likewise.
(do_pending_inlines): Likewise.
* decl2.c (finish_file): Unset DECL_STATIC_FUNCTION_P when we're
- done with it.
+ done with it.
Mon Mar 4 22:38:39 1996 Gerald Baumgartner <gb@alexander.cs.purdue.edu>
@@ -3435,9 +3528,9 @@ Mon Mar 4 22:38:39 1996 Gerald Baumgartner <gb@alexander.cs.purdue.edu>
Tue Mar 5 10:21:01 1996 Jason Merrill <jason@yorick.cygnus.com>
* method.c (hack_identifier): Requiring a static chain is now a
- hard error.
+ hard error.
* decl.c (grokdeclarator): Set DECL_NO_STATIC_CHAIN on nested
- functions.
+ functions.
Mon Mar 4 20:03:33 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -3449,7 +3542,7 @@ Mon Mar 4 20:03:33 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (tsubst_expr): Likewise.
* pt.c (tsubst): Use tsubst_expr for the second operand of an
- ARRAY_REF.
+ ARRAY_REF.
* decl.c (maybe_push_to_top_level): Don't save previous_class_type.
(poplevel_class): Set it here.
@@ -3457,14 +3550,14 @@ Mon Mar 4 20:03:33 1996 Jason Merrill <jason@yorick.cygnus.com>
* class.c (pushclass): Don't set it here.
* decl.c (maybe_push_to_top_level): Save current_template_parms,
- and clear it if !pseudo.
+ and clear it if !pseudo.
(pop_from_top_level): Restore it.
* decl2.c (finish_file): Push the dummy each time we walk the list
- of vtables.
+ of vtables.
* error.c (dump_expr): Support LOOKUP_EXPR and actually do
- something for CAST_EXPR.
+ something for CAST_EXPR.
Mon Feb 19 14:49:18 1996 Rusty Russell <rusty@adelaide.maptek.com.au>
@@ -3480,7 +3573,7 @@ Mon Mar 4 15:03:11 1996 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (mapcar): Propagate const and volatile properly.
* typeck.c (complete_type): Be sure to instantiate the
- MAIN_VARIANT of the type.
+ MAIN_VARIANT of the type.
* method.c (synthesize_method): Class interface hackery does not
apply to synthesized methods.
@@ -3488,10 +3581,10 @@ Mon Mar 4 15:03:11 1996 Jason Merrill <jason@yorick.cygnus.com>
Mon Mar 4 14:05:23 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (comp_template_args): Use comptypes rather than just
- checking for TEMPLATE_TYPE_PARM equivalence.
+ checking for TEMPLATE_TYPE_PARM equivalence.
* typeck.c (build_x_function_call): Call complete_type before
- checking TYPE_OVERLOADS_CALL_EXPR.
+ checking TYPE_OVERLOADS_CALL_EXPR.
Mon Mar 4 18:48:30 1996 Manfred Hollstein <manfred@lts.sel.alcatel.de>
@@ -3500,25 +3593,25 @@ Mon Mar 4 18:48:30 1996 Manfred Hollstein <manfred@lts.sel.alcatel.de>
Fri Mar 1 13:09:33 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_class_template): If we don't have a pattern
- yet, that's OK.
+ yet, that's OK.
(coerce_template_parms): If we see a local class, bail.
* decl.c (grok_reference_init): Make sure there's a type before
- checking its code.
+ checking its code.
* pt.c (do_function_instantiation): Avoid crashing on invalid decls.
(push_template_decl): Likewise.
* parse.y (named_class_head): Set
- CLASSTYPE_TEMPLATE_SPECIALIZATION here if we have basetypes.
+ CLASSTYPE_TEMPLATE_SPECIALIZATION here if we have basetypes.
* decl.c (xref_tag): Diagnose redeclaration of template
- type-parameter name.
+ type-parameter name.
* error.c (dump_type): Handle anonymous template type parms.
* pt.c (instantiate_template): Use TYPE_MAIN_DECL instead of
- TYPE_STUB_DECL.
+ TYPE_STUB_DECL.
(coerce_template_parms): Likewise.
Thu Feb 29 16:26:01 1996 Mike Stump <mrs@cygnus.com>
@@ -3529,11 +3622,11 @@ Thu Feb 29 16:26:01 1996 Mike Stump <mrs@cygnus.com>
Thu Feb 29 08:20:25 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_template): Take the MAIN_VARIANT of the type
- before trying to get its STUB_DECL.
+ before trying to get its STUB_DECL.
(coerce_template_parms): Likewise.
* parse.y (template_type_parm): If they didn't use 'class',
- pretend they did after giving an error.
+ pretend they did after giving an error.
* pt.c (coerce_template_parms): Diagnose use of local class.
@@ -3544,15 +3637,15 @@ Thu Feb 29 08:20:25 1996 Jason Merrill <jason@yorick.cygnus.com>
* parse.y (named_class_head): Diagnose mismatching types and tags.
* decl.c (pushdecl): Type decls and class templates clash with
- artificial type decls, not hide them.
+ artificial type decls, not hide them.
* decl.c (redeclaration_error_message): Diagnose redefinition of
- templates properly.
+ templates properly.
(duplicate_decls): Diagnose disallowed overloads for template
functions, too.
* decl.c (start_decl): Call complete_type before checking for a
- destructor.
+ destructor.
* pt.c (tsubst): Use tsubst_expr on the elts of a VEC.
@@ -3561,18 +3654,18 @@ Thu Feb 29 08:20:25 1996 Jason Merrill <jason@yorick.cygnus.com>
Wed Feb 28 09:28:44 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grok_op_properties): Don't check for operator++(int) in
- a template.
+ a template.
* tree.c (perm_manip): Return a copy of variable and function
- decls with external linkage.
+ decls with external linkage.
* tree.def: Change some of the min tree codes to type "1".
* pt.c (uses_template_parms): Handle 'e's, return 1 for LOOKUP_EXPRs.
* method.c (build_overload_int): Emit something arbitrary for
- anything but an INTEGER_CST if we're in a template.
+ anything but an INTEGER_CST if we're in a template.
* decl.c (cp_finish_decl): Call complete_type before deciding
- whether or not to lay out the decl.
+ whether or not to lay out the decl.
* lex.c (do_identifier): Check for DECL_INITIAL before using it.
@@ -3581,8 +3674,8 @@ Tue Feb 27 16:35:32 1996 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (build_x_arrow): Call complete_type.
* pt.c (add_pending_template): Broken out.
- (lookup_template_class): If -fexternal-templates, call it for all
- the methods of implemented types.
+ (lookup_template_class): If -fexternal-templates, call it for all
+ the methods of implemented types.
(instantiate_class_template): Instead of instantiating them here.
(instantiate_decl): Handle -fexternal-templates earlier.
@@ -3598,7 +3691,7 @@ Tue Feb 27 10:38:08 1996 Jason Merrill <jason@yorick.cygnus.com>
(grokdeclarator): Not here.
* parse.y (template_parm): Expand full_parm inline so we can set
- the rule's precedence.
+ the rule's precedence.
* pt.c (tsubst_expr): If we're in a template, just do tsubst_copy.
(tsubst): tsubst_expr the DECL_INITIAL of FIELD_DECLs.
@@ -3612,7 +3705,7 @@ Tue Feb 27 10:38:08 1996 Jason Merrill <jason@yorick.cygnus.com>
(tsubst_copy): Likewise.
* lex.c (do_identifier): Do pull the DECL_INITIAL out of a
- CONST_DECL for a template parm.
+ CONST_DECL for a template parm.
Mon Feb 26 12:48:18 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -3623,7 +3716,7 @@ Mon Feb 26 12:48:18 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (tsubst): Handle pointer-to-function declarators.
* method.c (hack_identifier): If pedantic, diagnose local class
- methods that require a static chain.
+ methods that require a static chain.
* decl.c (grok_op_properties): No longer static.
* cp-tree.h: Declare it.
@@ -3635,21 +3728,21 @@ Mon Feb 26 12:48:18 1996 Jason Merrill <jason@yorick.cygnus.com>
Fri Feb 23 14:51:52 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (coerce_template_parms): Don't coerce an expression using
- template parms.
+ template parms.
(uses_template_parms): Also check DECL_INITIAL in CONST_DECLs.
(tsubst): Don't use build_index_2_type if the max_value uses template
parms.
* method.c (build_overload_int): Emit something arbitrary for an
- expression using template parms.
+ expression using template parms.
* parse.y (template_close_bracket): New non-terminal to catch use
- of '>>' instead of '> >' in template class names.
+ of '>>' instead of '> >' in template class names.
(template_type): Use it.
* Makefile.in (CONFLICTS): Causes one more r/r conflict.
* tree.def: Add CAST_EXPR.
* typeck2.c (build_functional_cast): Use CAST_EXPR instead of
- CONVERT_EXPR for minimal_parse_mode.
+ CONVERT_EXPR for minimal_parse_mode.
* typeck.c (build_c_cast): Likewise.
* pt.c (tsubst_copy): Likewise.
* decl2.c (build_expr_from_tree): Likewise.
@@ -3791,7 +3884,7 @@ Thu Feb 22 13:24:15 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Thu Feb 22 13:19:44 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (do_poplevel): Oops; really return what we get from
- poplevel this time.
+ poplevel this time.
Thu Feb 22 11:41:44 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -3863,10 +3956,10 @@ Thu Feb 22 11:41:44 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Thu Feb 22 00:54:22 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (tsubst): Only look for matching decls at file scope for
- non-member functions.
+ non-member functions.
* call.c (build_scoped_method_call): Handle scoped destructor
- calls in templates.
+ calls in templates.
* decl.c (*_top_level): Also save previous_class_values.
@@ -3875,16 +3968,16 @@ Thu Feb 22 00:54:22 1996 Jason Merrill <jason@yorick.cygnus.com>
* tree.def: Likewise.
* method.c (build_overload_identifier): For a class nested in a
- template class, don't mangle in the template parms from our
- context.
+ template class, don't mangle in the template parms from our
+ context.
* lex.c, cp-tree.h: Remove support for template instantiations in
- the pending_inlines code.
+ the pending_inlines code.
* pt.c: Remove dead functions and unused arguments.
(uses_template_parms): TYPENAME_TYPEs always use template parms.
* parse.y: Stop passing anything to end_template_decl.
* tree.c (print_lang_statistics): Only print tinst info #ifdef
- GATHER_STATISTICS.
+ GATHER_STATISTICS.
Wed Feb 21 16:57:33 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -3976,11 +4069,11 @@ Wed Feb 21 00:06:17 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (import_export_decl): Renamed from import_export_inline.
(finish_file): Call it to do interface handling for statics.
* pt.c (tsubst_copy): Call mark_used on variables and functions
- used here.
+ used here.
* decl2.c (finish_file): Don't emit statics we can't generate.
* pt.c (instantiate_decl): Don't set interface on instantiations
- we can't generate.
+ we can't generate.
* cp-tree.h (struct tinst_level): Change 'classname' to 'decl'.
* tree.c (print_lang_statistics): Print max template depth.
@@ -3989,14 +4082,14 @@ Wed Feb 21 00:06:17 1996 Jason Merrill <jason@yorick.cygnus.com>
(instantiate_decl): Likewise.
* call.c class.c cp-tree.h decl.c decl2.c error.c lex.c method.c
- pt.c ptree.c tree.def: Remove all traces of UNINSTANTIATED_P_TYPE.
+ pt.c ptree.c tree.def: Remove all traces of UNINSTANTIATED_P_TYPE.
Tue Feb 20 18:21:51 1996 Jason Merrill <jason@yorick.cygnus.com>
* call.c class.c cp-tree.h cvt.c decl.c decl2.c error.c expr.c
- init.c lex.c method.c parse.y pt.c repo.c search.c spew.c tree.c
- tree.def typeck.c typeck2.c xref.c: Massive, systemic changes for
- the new template implementation.
+ init.c lex.c method.c parse.y pt.c repo.c search.c spew.c tree.c
+ tree.def typeck.c typeck2.c xref.c: Massive, systemic changes for
+ the new template implementation.
Tue Feb 20 17:14:29 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
@@ -4032,8 +4125,8 @@ Wed Feb 14 17:30:04 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Wed Feb 14 16:21:25 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (push_to_top_level): Start from current_binding_level
- again for now; the stl hacks depend on g++ being broken in this
- way, and it'll be fixed in the template rewrite.
+ again for now; the stl hacks depend on g++ being broken in this
+ way, and it'll be fixed in the template rewrite.
* tree.def: Add USING_DECL.
* decl2.c (do_class_using_decl): Implement.
@@ -4042,7 +4135,7 @@ Wed Feb 14 16:21:25 1996 Jason Merrill <jason@yorick.cygnus.com>
* error.c (dump_decl): Handle USING_DECLs.
* decl.c (grokdeclarator): Remove code for handling access decls.
* class.c (finish_struct_1): Adjust accordingly, treat using-decls
- as access decls for now.
+ as access decls for now.
(finish_struct): Don't check USING_DECLs for other uses of the name.
* search.c (get_matching_virtual): Use cp_error_at.
@@ -4074,14 +4167,14 @@ Wed Feb 14 10:36:58 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Tue Feb 13 12:51:21 1996 Jason Merrill <jason@yorick.cygnus.com>
* class.c (finish_struct_1): Check for a pure-specifier on a
- non-virtual function here.
+ non-virtual function here.
* decl2.c (grok_function_init): Don't check whether the function
- is virtual here.
+ is virtual here.
(grokfield): Don't call check_for_override here.
* decl.c (push_to_top_level): Start from inner_binding_level,
- check class_shadowed in class levels.
+ check class_shadowed in class levels.
Mon Feb 12 17:46:59 1996 Mike Stump <mrs@cygnus.com>
@@ -4095,7 +4188,7 @@ Mon Feb 12 15:47:44 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Sat Feb 10 17:59:45 1996 Jason Merrill <jason@yorick.cygnus.com>
* class.c (finish_struct_1): Set DECL_VINDEX properly on a
- synthesized dtor.
+ synthesized dtor.
* parse.y (complete_type_name): Bind global_scope earlier.
(complex_type_name): Likewise.
@@ -4104,18 +4197,18 @@ Sat Feb 10 17:59:45 1996 Jason Merrill <jason@yorick.cygnus.com>
Thu Feb 8 15:15:14 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokfndecl): Move code that looks for virtuals in base
- classes...
+ classes...
* class.c (check_for_override): ... to a new function.
(finish_struct_1): Call it.
* cp-tree.h: Declare warn_sign_compare.
* typeck.c (build_binary_op_nodefault): Check warn_sign_compare
- rather than extra_warnings to decide whether to warn about
- comparison of signed and unsigned.
+ rather than extra_warnings to decide whether to warn about
+ comparison of signed and unsigned.
* decl2.c (lang_decode_option): Handle warn_sign_compare. -Wall
- implies -Wsign-compare. -Wall doesn't imply -W.
+ implies -Wsign-compare. -Wall doesn't imply -W.
Wed Feb 7 15:27:57 1996 Mike Stump <mrs@cygnus.com>
@@ -4142,7 +4235,7 @@ Tue Feb 6 13:39:22 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
Make the C++ front-end pay attention to attributes for structures.
* class.c (finish_struct): New argument ATTRIBUTES, passed down into
finish_struct_1.
- (finish_struct_1): New argument ATTRIBUTES; call cplus_decl_attributes.
+ (finish_struct_1): New argument ATTRIBUTES; call cplus_decl_attributes.
Take out old round_up_size use and setting the DECL_ALIGN possibly
using it. Take out setting of TYPE_ALIGN to round_up_size, which
can override what the attribute set.
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 2dcfe43425c..264114c33d7 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -144,7 +144,7 @@ tinfo2.o: cc1plus $(srcdir)/cp/tinfo2.cc
-c $(srcdir)/cp/tinfo2.cc
exception.o: cc1plus $(srcdir)/cp/exception.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
- -c -O0 -fexceptions $(srcdir)/cp/exception.cc
+ -c -fexceptions $(srcdir)/cp/exception.cc
new.o: cc1plus $(srcdir)/cp/new.cc
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new.cc
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index df4ced9af19..2b69c085a02 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3187,13 +3187,18 @@ reference_binding (rto, rfrom, expr, flags)
int lvalue = 1;
tree to = TREE_TYPE (rto);
tree from = rfrom;
+ int related;
if (TREE_CODE (from) == REFERENCE_TYPE)
from = TREE_TYPE (from);
else if (! expr || ! real_lvalue_p (expr))
lvalue = 0;
- if (lvalue
+ related = (TYPE_MAIN_VARIANT (to) == TYPE_MAIN_VARIANT (from)
+ || (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
+ && DERIVED_FROM_P (to, from)));
+
+ if (lvalue && related
&& TYPE_READONLY (to) >= TYPE_READONLY (from)
&& TYPE_VOLATILE (to) >= TYPE_VOLATILE (from))
{
@@ -3201,14 +3206,11 @@ reference_binding (rto, rfrom, expr, flags)
if (TYPE_MAIN_VARIANT (to) == TYPE_MAIN_VARIANT (from))
conv = build_conv (REF_BIND, rto, conv);
- else if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
- && DERIVED_FROM_P (to, from))
+ else
{
conv = build_conv (REF_BIND, rto, conv);
ICS_STD_RANK (conv) = STD_RANK;
}
- else
- conv = NULL_TREE;
}
else
conv = NULL_TREE;
@@ -3225,8 +3227,15 @@ reference_binding (rto, rfrom, expr, flags)
if (TREE_CODE (TREE_OPERAND (conv, 0)) == BASE_CONV)
TREE_OPERAND (conv, 0) = TREE_OPERAND (TREE_OPERAND (conv, 0), 0);
}
- if (conv && ! (TYPE_READONLY (to) && ! TYPE_VOLATILE (to)
- && (flags & LOOKUP_NO_TEMP_BIND) == 0))
+ if (conv
+ && ((! (TYPE_READONLY (to) && ! TYPE_VOLATILE (to)
+ && (flags & LOOKUP_NO_TEMP_BIND) == 0))
+ /* If T1 is reference-related to T2, cv1 must be the same
+ cv-qualification as, or greater cv-qualification than,
+ cv2; otherwise, the program is ill-formed. */
+ || (related
+ && (TYPE_READONLY (to) < TYPE_READONLY (from)
+ || TYPE_VOLATILE (to) < TYPE_VOLATILE (from)))))
ICS_BAD_FLAG (conv) = 1;
}
@@ -3265,7 +3274,12 @@ implicit_conversion (to, from, expr, flags)
|| IS_AGGR_TYPE (non_reference (to)))
&& (flags & LOOKUP_NO_CONVERSION) == 0)
{
- if (TREE_CODE (to) == REFERENCE_TYPE
+ cand = build_user_type_conversion_1
+ (to, expr, LOOKUP_ONLYCONVERTING);
+ if (cand)
+ conv = cand->second_conv;
+ if ((! conv || ICS_BAD_FLAG (conv))
+ && TREE_CODE (to) == REFERENCE_TYPE
&& TYPE_READONLY (TREE_TYPE (to))
&& ! TYPE_VOLATILE (TREE_TYPE (to))
&& (flags & LOOKUP_NO_TEMP_BIND) == 0)
@@ -3275,13 +3289,6 @@ implicit_conversion (to, from, expr, flags)
if (cand)
conv = build_conv (REF_BIND, to, cand->second_conv);
}
- else
- {
- cand = build_user_type_conversion_1
- (to, expr, LOOKUP_ONLYCONVERTING);
- if (cand)
- conv = cand->second_conv;
- }
}
return conv;
@@ -4181,7 +4188,10 @@ print_z_candidates (candidates)
}
/* Returns the best overload candidate to perform the requested
- conversion. */
+ conversion. This function is used for three the overloading situations
+ described in [over.match.copy], [over.match.conv], and [over.match.ref].
+ If TOTYPE is a REFERENCE_TYPE, we're trying to find an lvalue binding as
+ per [dcl.init.ref], so we ignore temporary bindings. */
static struct z_candidate *
build_user_type_conversion_1 (totype, expr, flags)
@@ -4229,9 +4239,22 @@ build_user_type_conversion_1 (totype, expr, flags)
for (; convs; convs = TREE_CHAIN (convs))
{
tree fn = TREE_VALUE (convs);
- tree ics = implicit_conversion
- (totype, TREE_TYPE (TREE_TYPE (fn)), 0, LOOKUP_NO_CONVERSION);
- if (ics)
+ int convflags = LOOKUP_NO_CONVERSION;
+ tree ics;
+
+ /* If we are called to convert to a reference type, we are trying to
+ find an lvalue binding, so don't even consider temporaries. If
+ we don't find an lvalue binding, the caller will try again to
+ look for a temporary binding. */
+ if (TREE_CODE (totype) == REFERENCE_TYPE)
+ convflags |= LOOKUP_NO_TEMP_BIND;
+
+ ics = implicit_conversion
+ (totype, TREE_TYPE (TREE_TYPE (fn)), 0, convflags);
+
+ if (TREE_CODE (totype) == REFERENCE_TYPE && ics && ICS_BAD_FLAG (ics))
+ /* ignore the near match. */;
+ else if (ics)
for (; fn; fn = DECL_CHAIN (fn))
{
candidates = add_function_candidate (candidates, fn, args, flags);
@@ -4348,9 +4371,10 @@ build_new_function_call (fn, args, obj)
{
if (candidates && ! candidates->next)
return build_function_call (candidates->fn, args);
- else
- cp_error ("no matching function for call to `%D (%A)'",
- TREE_PURPOSE (fn), args);
+ cp_error ("no matching function for call to `%D (%A)'",
+ TREE_PURPOSE (fn), args);
+ if (candidates)
+ print_z_candidates (candidates);
return error_mark_node;
}
candidates = splice_viable (candidates);
@@ -5037,11 +5061,12 @@ build_over_call (fn, convs, args, flags)
is_method = 1;
}
- for (; conv = TREE_VEC_ELT (convs, i), arg && parm;
+ for (; arg && parm;
parm = TREE_CHAIN (parm), arg = TREE_CHAIN (arg), ++i)
{
tree type = TREE_VALUE (parm);
+ conv = TREE_VEC_ELT (convs, i);
if (ICS_BAD_FLAG (conv))
{
tree t = conv;
@@ -5118,17 +5143,24 @@ build_over_call (fn, convs, args, flags)
&& TREE_VEC_LENGTH (convs) == 1
&& copy_args_p (fn))
{
- tree targ = NULL_TREE;
+ tree targ;
arg = TREE_VALUE (TREE_CHAIN (converted_args));
/* Pull out the real argument, disregarding const-correctness. */
- if (TREE_CODE (arg) == ADDR_EXPR)
- {
- targ = TREE_OPERAND (arg, 0);
+ targ = arg;
+ while (TREE_CODE (targ) == NOP_EXPR
+ || TREE_CODE (targ) == NON_LVALUE_EXPR
+ || TREE_CODE (targ) == CONVERT_EXPR)
+ targ = TREE_OPERAND (targ, 0);
+ if (TREE_CODE (targ) == ADDR_EXPR)
+ {
+ targ = TREE_OPERAND (targ, 0);
if (! comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (arg))),
TYPE_MAIN_VARIANT (TREE_TYPE (targ)), 1))
targ = NULL_TREE;
}
+ else
+ targ = NULL_TREE;
if (targ)
arg = targ;
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 5ada32baf9e..b527738f88d 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2809,6 +2809,7 @@ check_for_override (decl, ctype)
}
virtualp = 1;
+#if 0 /* The signature of an overriding function is not changed. */
{
/* The argument types may have changed... */
tree type = TREE_TYPE (decl);
@@ -2823,9 +2824,10 @@ check_for_override (decl, ctype)
if (raises)
type = build_exception_variant (type, raises);
TREE_TYPE (decl) = type;
- DECL_VINDEX (decl)
- = tree_cons (NULL_TREE, tmp, DECL_VINDEX (decl));
}
+#endif
+ DECL_VINDEX (decl)
+ = tree_cons (NULL_TREE, tmp, DECL_VINDEX (decl));
break;
}
}
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 31cc776a7c0..ac00c5b573b 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1195,10 +1195,12 @@ extern int flag_new_for_scope;
#define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \
&& CONSTRUCTOR_ELTS (NODE) == NULL_TREE)
+#if 0
/* Indicates that a NON_LVALUE_EXPR came from a C++ reference.
Used to generate more helpful error message in case somebody
tries to take its address. */
#define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE))
+#endif
/* Nonzero for _TYPE means that the _TYPE defines a destructor. */
#define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index cf961156411..b0cf12b4e69 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -371,232 +371,24 @@ convert_to_pointer_force (type, expr)
value we have to begin with is in ARG.
FLAGS controls how we manage access checking.
- DIRECT_BIND in FLAGS controls how any temporarys are generated.
- CHECKCONST controls if we report error messages on const subversion. */
+ DIRECT_BIND in FLAGS controls how any temporaries are generated. */
static tree
build_up_reference (type, arg, flags, checkconst)
tree type, arg;
int flags, checkconst;
{
- tree rval, targ;
- int literal_flag = 0;
+ tree rval;
tree argtype = TREE_TYPE (arg);
tree target_type = TREE_TYPE (type);
- tree binfo = NULL_TREE;
my_friendly_assert (TREE_CODE (type) == REFERENCE_TYPE, 187);
- if ((flags & LOOKUP_PROTECT)
- && TYPE_MAIN_VARIANT (argtype) != TYPE_MAIN_VARIANT (target_type)
- && IS_AGGR_TYPE (argtype)
- && IS_AGGR_TYPE (target_type))
- {
- binfo = get_binfo (target_type, argtype, 1);
- if (binfo == error_mark_node)
- return error_mark_node;
- if (binfo == NULL_TREE)
- return error_not_base_type (target_type, argtype);
- }
-
- /* Pass along const and volatile down into the type. */
- if (TYPE_READONLY (type) || TYPE_VOLATILE (type))
- target_type = cp_build_type_variant (target_type, TYPE_READONLY (type),
- TYPE_VOLATILE (type));
- targ = arg;
- if (TREE_CODE (targ) == SAVE_EXPR)
- targ = TREE_OPERAND (targ, 0);
- while (TREE_CODE (targ) == NOP_EXPR
- && (TYPE_MAIN_VARIANT (argtype)
- == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (targ, 0)))))
- targ = TREE_OPERAND (targ, 0);
-
- switch (TREE_CODE (targ))
- {
- case INDIRECT_REF:
- /* This is a call to a constructor which did not know what it was
- initializing until now: it needs to initialize a temporary. */
- if (TREE_HAS_CONSTRUCTOR (targ))
- {
- tree temp = build_cplus_new (argtype, TREE_OPERAND (targ, 0));
- TREE_HAS_CONSTRUCTOR (targ) = 0;
- return build_up_reference (type, temp, flags, 1);
- }
- /* Let &* cancel out to simplify resulting code.
- Also, throw away intervening NOP_EXPRs. */
- arg = TREE_OPERAND (targ, 0);
- if (TREE_CODE (arg) == NOP_EXPR || TREE_CODE (arg) == NON_LVALUE_EXPR
- || (TREE_CODE (arg) == CONVERT_EXPR && TREE_REFERENCE_EXPR (arg)))
- arg = TREE_OPERAND (arg, 0);
-
- /* in doing a &*, we have to get rid of the const'ness on the pointer
- value. Haven't thought about volatile here. Pointers come to mind
- here. */
- if (TREE_READONLY (arg))
- {
- arg = copy_node (arg);
- TREE_READONLY (arg) = 0;
- }
-
- rval = build1 (CONVERT_EXPR, type, arg);
- TREE_REFERENCE_EXPR (rval) = 1;
-
- /* propagate the const flag on something like:
-
- class Base {
- public:
- int foo;
- };
-
- class Derived : public Base {
- public:
- int bar;
- };
-
- void func(Base&);
-
- void func2(const Derived& d) {
- func(d);
- }
-
- on the d parameter. The below could have been avoided, if the flags
- were down in the tree, not sure why they are not. (mrs) */
- /* The below code may have to be propagated to other parts of this
- switch. */
- if (TREE_READONLY (targ) && !TREE_READONLY (arg)
- && (TREE_CODE (arg) == PARM_DECL || TREE_CODE (arg) == VAR_DECL)
- && TREE_CODE (TREE_TYPE (arg)) == REFERENCE_TYPE
- && (TYPE_READONLY (target_type) && checkconst))
- {
- arg = copy_node (arg);
- TREE_READONLY (arg) = TREE_READONLY (targ);
- }
- literal_flag = TREE_CONSTANT (arg);
-
- goto done;
-
- /* Get this out of a register if we happened to be in one by accident.
- Also, build up references to non-lvalues it we must. */
- /* For &x[y], return (&) x+y */
- case ARRAY_REF:
- if (mark_addressable (TREE_OPERAND (targ, 0)) == 0)
- return error_mark_node;
- rval = build_binary_op (PLUS_EXPR, TREE_OPERAND (targ, 0),
- TREE_OPERAND (targ, 1), 1);
- TREE_TYPE (rval) = type;
- if (TREE_CONSTANT (TREE_OPERAND (targ, 1))
- && staticp (TREE_OPERAND (targ, 0)))
- TREE_CONSTANT (rval) = 1;
- goto done;
-
- case SCOPE_REF:
- /* Could be a reference to a static member. */
- {
- tree field = TREE_OPERAND (targ, 1);
- if (TREE_STATIC (field))
- {
- rval = build1 (ADDR_EXPR, type, field);
- literal_flag = 1;
- goto done;
- }
- }
-
- /* We should have farmed out member pointers above. */
- my_friendly_abort (188);
- case COMPONENT_REF:
- rval = build_component_addr (targ, build_pointer_type (argtype),
- "attempt to make a reference to bit-field structure member `%s'");
- TREE_TYPE (rval) = type;
- literal_flag = staticp (TREE_OPERAND (targ, 0));
-
- goto done;
-
- /* Anything not already handled and not a true memory reference
- needs to have a reference built up. Do so silently for
- things like integers and return values from function,
- but complain if we need a reference to something declared
- as `register'. */
-
- case PARM_DECL:
- /* 'this' is not an lvalue. */
- if (targ == current_class_ptr && ! flag_this_is_variable)
- break;
-
- case RESULT_DECL:
- case VAR_DECL:
- case CONST_DECL:
- if (staticp (targ))
- literal_flag = 1;
-
- /* Fall through. */
- case TARGET_EXPR:
- mark_addressable (targ);
- break;
-
- case COMPOUND_EXPR:
- {
- tree real_reference = build_up_reference (type, TREE_OPERAND (targ, 1),
- flags, checkconst);
- rval = build (COMPOUND_EXPR, type, TREE_OPERAND (targ, 0), real_reference);
- TREE_CONSTANT (rval) = staticp (TREE_OPERAND (targ, 1));
- return rval;
- }
-
- case PREINCREMENT_EXPR:
- case PREDECREMENT_EXPR:
- case MODIFY_EXPR:
- case INIT_EXPR:
- {
- tree real_reference = build_up_reference (type, TREE_OPERAND (targ, 0),
- flags, checkconst);
- rval = build (COMPOUND_EXPR, type, arg, real_reference);
- TREE_CONSTANT (rval) = staticp (TREE_OPERAND (targ, 0));
- return rval;
- }
-
- case COND_EXPR:
- return build (COND_EXPR, type,
- TREE_OPERAND (targ, 0),
- build_up_reference (type, TREE_OPERAND (targ, 1),
- flags, checkconst),
- build_up_reference (type, TREE_OPERAND (targ, 2),
- flags, checkconst));
-
- /* Undo the folding... */
- case MIN_EXPR:
- case MAX_EXPR:
- return build (COND_EXPR, type,
- build (TREE_CODE (targ) == MIN_EXPR ? LT_EXPR : GT_EXPR,
- boolean_type_node, TREE_OPERAND (targ, 0),
- TREE_OPERAND (targ, 1)),
- build_up_reference (type, TREE_OPERAND (targ, 0),
- flags, checkconst),
- build_up_reference (type, TREE_OPERAND (targ, 1),
- flags, checkconst));
-
- case BIND_EXPR:
- arg = TREE_OPERAND (targ, 1);
- if (arg == NULL_TREE)
- {
- compiler_error ("({ ... }) expression not expanded when needed for reference");
- return error_mark_node;
- }
- rval = build1 (ADDR_EXPR, type, arg);
- TREE_REFERENCE_EXPR (rval) = 1;
- return rval;
-
- default:
- break;
- }
-
- if ((flags & DIRECT_BIND)
- && ! real_lvalue_p (targ))
+ if ((flags & DIRECT_BIND) && ! real_lvalue_p (arg))
{
+ tree targ = arg;
if (toplevel_bindings_p ())
- {
- arg = get_temp_name (argtype, 1);
- literal_flag = 1;
- }
+ arg = get_temp_name (argtype, 1);
else
{
arg = pushdecl (build_decl (VAR_DECL, NULL_TREE, argtype));
@@ -605,7 +397,7 @@ build_up_reference (type, arg, flags, checkconst)
DECL_INITIAL (arg) = targ;
cp_finish_decl (arg, targ, NULL_TREE, 0, LOOKUP_ONLYCONVERTING);
}
- else if (TREE_ADDRESSABLE (targ) == 0 && !(flags & DIRECT_BIND))
+ else if (!(flags & DIRECT_BIND) && ! lvalue_p (arg))
{
tree slot = build_decl (VAR_DECL, NULL_TREE, argtype);
arg = build (TARGET_EXPR, argtype, slot, arg, NULL_TREE, NULL_TREE);
@@ -614,25 +406,14 @@ build_up_reference (type, arg, flags, checkconst)
/* If we had a way to wrap this up, and say, if we ever needed it's
address, transform all occurrences of the register, into a memory
reference we could win better. */
- mark_addressable (arg);
- rval = build1 (ADDR_EXPR, type, arg);
-
- done:
- if (TYPE_USES_COMPLEX_INHERITANCE (argtype)
- || TYPE_USES_COMPLEX_INHERITANCE (target_type))
- {
- TREE_TYPE (rval) = build_pointer_type (argtype);
- if (flags & LOOKUP_PROTECT)
- rval = convert_pointer_to (target_type, rval);
- else
- rval
- = convert_to_pointer_force (build_pointer_type (target_type), rval);
- TREE_TYPE (rval) = type;
- if (TREE_CODE (rval) == PLUS_EXPR || TREE_CODE (rval) == MINUS_EXPR)
- TREE_TYPE (TREE_OPERAND (rval, 0))
- = TREE_TYPE (TREE_OPERAND (rval, 1)) = type;
- }
- TREE_CONSTANT (rval) = literal_flag;
+ rval = build_unary_op (ADDR_EXPR, arg, 1);
+ if (flags & LOOKUP_PROTECT)
+ rval = convert_pointer_to (target_type, rval);
+ else
+ rval
+ = convert_to_pointer_force (build_pointer_type (target_type), rval);
+ rval = build1 (CONVERT_EXPR, type, rval);
+ TREE_CONSTANT (rval) = TREE_CONSTANT (TREE_OPERAND (rval, 0));
return rval;
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 1fd2026f118..36dc140093a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -49,8 +49,6 @@ extern struct obstack permanent_obstack;
extern int current_class_depth;
-extern tree cleanups_this_call;
-
extern tree static_ctors, static_dtors;
/* Stack of places to restore the search obstack back to. */
@@ -5012,6 +5010,18 @@ init_decl_processing ()
BUILT_IN_NEXT_ARG, NULL_PTR);
builtin_function ("__builtin_args_info", int_ftype_int,
BUILT_IN_ARGS_INFO, NULL_PTR);
+ builtin_function ("__builtin_setjmp",
+ build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, ptr_type_node,
+ endlink)),
+ BUILT_IN_SETJMP, NULL_PTR);
+ builtin_function ("__builtin_longjmp",
+ build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, ptr_type_node,
+ tree_cons (NULL_TREE,
+ integer_type_node,
+ endlink))),
+ BUILT_IN_LONGJMP, NULL_PTR);
/* Untyped call and return. */
builtin_function ("__builtin_apply_args", ptr_ftype,
@@ -6569,11 +6579,6 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
}
else if (! toplev)
{
- extern int temp_slot_level;
- extern int target_temp_slot_level;
- tree old_cleanups = cleanups_this_call;
- int old_temp_level = target_temp_slot_level;
-
/* This is a declared decl which must live until the
end of the binding contour. It may need a cleanup. */
@@ -6654,9 +6659,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
}
}
- push_temp_slots ();
- push_temp_slots ();
- target_temp_slot_level = temp_slot_level;
+ expand_start_target_temps ();
if (DECL_SIZE (decl) && type != error_mark_node)
{
@@ -6679,11 +6682,9 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
&& DECL_NAME (decl))
TREE_USED (decl) = 0;
}
+
/* Cleanup any temporaries needed for the initial value. */
- expand_cleanups_to (old_cleanups);
- pop_temp_slots ();
- pop_temp_slots ();
- target_temp_slot_level = old_temp_level;
+ expand_end_target_temps ();
if (DECL_SIZE (decl) && type != error_mark_node)
{
@@ -6777,11 +6778,6 @@ expand_static_init (decl, init)
/* Emit code to perform this initialization but once. */
tree temp;
- extern int temp_slot_level;
- extern int target_temp_slot_level;
- tree old_cleanups;
- int old_temp_level;
-
/* Remember this information until end of file. */
push_obstacks (&permanent_obstack, &permanent_obstack);
@@ -6790,11 +6786,7 @@ expand_static_init (decl, init)
rest_of_decl_compilation (temp, NULL_PTR, 0, 0);
expand_start_cond (build_binary_op (EQ_EXPR, temp,
integer_zero_node, 1), 0);
- old_cleanups = cleanups_this_call;
- old_temp_level = target_temp_slot_level;
- push_temp_slots ();
- push_temp_slots ();
- target_temp_slot_level = temp_slot_level;
+ expand_start_target_temps ();
expand_assignment (temp, integer_one_node, 0, 0);
if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))
@@ -6807,10 +6799,7 @@ expand_static_init (decl, init)
expand_assignment (decl, init, 0, 0);
/* Cleanup any temporaries needed for the initial value. */
- expand_cleanups_to (old_cleanups);
- pop_temp_slots ();
- pop_temp_slots ();
- target_temp_slot_level = old_temp_level;
+ expand_end_target_temps ();
if (TYPE_NEEDS_DESTRUCTOR (TREE_TYPE (decl)))
{
@@ -9195,9 +9184,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
}
/* Tell grokfndecl if it needs to set TREE_PUBLIC on the node. */
- publicp = (! friendp
- || RIDBIT_SETP (RID_EXTERN, specbits)
- || ! (funcdef_flag < 0 || inlinep));
+ publicp = (! friendp || ! staticp);
decl = grokfndecl (ctype, type, declarator,
virtualp, flags, quals, raises, attrlist,
friendp ? -1 : 0, publicp, inlinep,
@@ -9395,11 +9382,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
type = build_cplus_method_type (build_type_variant (ctype, constp, volatilep),
TREE_TYPE (type), TYPE_ARG_TYPES (type));
- /* Record presence of `static'. In C++, `inline' implies `static'. */
+ /* Record presence of `static'. */
publicp = (ctype != NULL_TREE
|| RIDBIT_SETP (RID_EXTERN, specbits)
- || (!RIDBIT_SETP (RID_STATIC, specbits)
- && !RIDBIT_SETP (RID_INLINE, specbits)));
+ || !RIDBIT_SETP (RID_STATIC, specbits));
decl = grokfndecl (ctype, type, original_name,
virtualp, flags, quals, raises, attrlist,
@@ -11281,6 +11267,7 @@ store_parm_decls ()
register tree fndecl = current_function_decl;
register tree parm;
int parms_have_cleanups = 0;
+ tree cleanups = NULL_TREE;
/* This is either a chain of PARM_DECLs (when a prototype is used). */
tree specparms = current_function_parms;
@@ -11355,10 +11342,10 @@ store_parm_decls ()
&& (cleanup = maybe_build_cleanup (parm), cleanup))
{
expand_decl (parm);
- if (! expand_decl_cleanup (parm, cleanup))
- cp_error ("parser lost in parsing declaration of `%D'",
- parm);
parms_have_cleanups = 1;
+
+ /* Keep track of the cleanups. */
+ cleanups = tree_cons (parm, cleanup, cleanups);
}
}
else
@@ -11392,6 +11379,20 @@ store_parm_decls ()
if (! processing_template_decl)
expand_function_start (fndecl, parms_have_cleanups);
+ /* Now that we have initialized the parms, we can start their
+ cleanups. We cannot do this before, since expand_decl_cleanup
+ should not be called before the parm can be used. */
+ if (parms_have_cleanups
+ && ! processing_template_decl)
+ {
+ for (cleanups = nreverse (cleanups); cleanups; cleanups = TREE_CHAIN (cleanups))
+ {
+ if (! expand_decl_cleanup (TREE_PURPOSE (cleanups), TREE_VALUE (cleanups)))
+ cp_error ("parser lost in parsing declaration of `%D'",
+ TREE_PURPOSE (cleanups));
+ }
+ }
+
/* Create a binding contour which can be used to catch
cleanup-generated temporaries. Also, if the return value needs or
has initialization, deal with that now. */
@@ -12329,9 +12330,6 @@ maybe_build_cleanup_1 (decl, auto_delete)
rval = build_compound_expr (tree_cons (NULL_TREE, rval,
build_tree_list (NULL_TREE, build_vbase_delete (type, decl))));
- /* Since this is a cleanup, UNSAVE it now. */
- rval = unsave_expr (rval);
-
if (TREE_CODE (decl) != PARM_DECL)
resume_momentary (temp);
@@ -12372,20 +12370,15 @@ void
cplus_expand_expr_stmt (exp)
tree exp;
{
- extern int temp_slot_level;
- extern int target_temp_slot_level;
- tree old_cleanups = cleanups_this_call;
- int old_temp_level = target_temp_slot_level;
- push_temp_slots ();
- push_temp_slots ();
- target_temp_slot_level = temp_slot_level;
-
if (processing_template_decl)
{
add_tree (build_min_nt (EXPR_STMT, exp));
return;
}
+ /* Arrange for all temps to disappear. */
+ expand_start_target_temps ();
+
if (TREE_TYPE (exp) == unknown_type_node)
{
if (TREE_CODE (exp) == ADDR_EXPR || TREE_CODE (exp) == TREE_LIST)
@@ -12415,16 +12408,7 @@ cplus_expand_expr_stmt (exp)
/* Clean up any pending cleanups. This happens when a function call
returns a cleanup-needing value that nobody uses. */
- expand_cleanups_to (old_cleanups);
- pop_temp_slots ();
- pop_temp_slots ();
- target_temp_slot_level = old_temp_level;
- /* There might something left from building the trees. */
- if (cleanups_this_call)
- {
- expand_cleanups_to (NULL_TREE);
- }
- free_temp_slots ();
+ expand_end_target_temps ();
}
/* When a stmt has been parsed, this function is called.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 60a27a41f9a..1e8577af6b2 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -38,7 +38,6 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
extern tree get_file_function_name ();
-extern tree cleanups_this_call;
static void grok_function_init PROTO((tree, tree));
void import_export_decl ();
extern int current_class_depth;
@@ -420,7 +419,6 @@ static struct { char *string; int *variable; int on_value;} lang_f_options[] =
{"huge-objects", &flag_huge_objects, 1},
{"conserve-space", &flag_conserve_space, 1},
{"vtable-thunks", &flag_vtable_thunks, 1},
- {"short-temps", &flag_short_temps, 1},
{"access-control", &flag_access_control, 1},
{"nonansi-builtins", &flag_no_nonansi_builtin, 0},
{"gnu-keywords", &flag_no_gnu_keywords, 0},
@@ -2919,15 +2917,8 @@ finish_file ()
while (vars)
{
- extern int temp_slot_level;
- extern int target_temp_slot_level;
tree decl = TREE_VALUE (vars);
tree init = TREE_PURPOSE (vars);
- tree old_cleanups = cleanups_this_call;
- int old_temp_level = target_temp_slot_level;
- push_temp_slots ();
- push_temp_slots ();
- target_temp_slot_level = temp_slot_level;
/* If this was a static attribute within some function's scope,
then don't initialize it here. Also, don't bother
@@ -2940,9 +2931,9 @@ finish_file ()
if (TREE_CODE (decl) == VAR_DECL)
{
- int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
- || DECL_ONE_ONLY (decl)
- || DECL_WEAK (decl)));
+ int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
+ || DECL_ONE_ONLY (decl)
+ || DECL_WEAK (decl)));
/* Set these global variables so that GDB at least puts
us near the declaration which required the initialization. */
@@ -2964,6 +2955,8 @@ finish_file ()
expand_start_cond (sentry, 0);
}
+ expand_start_target_temps ();
+
if (IS_AGGR_TYPE (TREE_TYPE (decl))
|| TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
expand_aggr_init (decl, init, 0, 0);
@@ -2977,6 +2970,9 @@ finish_file ()
else
expand_assignment (decl, init, 0, 0);
+ /* Cleanup any temporaries needed for the initial value. */
+ expand_end_target_temps ();
+
if (protect)
expand_end_cond ();
@@ -2987,13 +2983,7 @@ finish_file ()
;
else my_friendly_abort (22);
- /* Cleanup any temporaries needed for the initial value. */
- expand_cleanups_to (old_cleanups);
next_mess:
- pop_temp_slots ();
- pop_temp_slots ();
- target_temp_slot_level = old_temp_level;
-
vars = TREE_CHAIN (vars);
}
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 37f6dfea6c7..efe97626a74 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -35,12 +35,12 @@ Boston, MA 02111-1307, USA. */
rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx));
-/* holds the fndecl for __builtin_return_address () */
+/* Holds the fndecl for __builtin_return_address. */
tree builtin_return_address_fndecl;
/* A couple of backend routines from m88k.c */
-/* used to cache a call to __builtin_return_address () */
+/* Used to cache a call to __builtin_return_address. */
static tree BuiltinReturnAddress;
@@ -163,18 +163,17 @@ extern rtx gen_nop PROTO(());
/* local globals for function calls
====================================================================== */
-/* used to cache "terminate ()", "unexpected ()", "set_terminate ()", and
- "set_unexpected ()" after default_conversion. (lib-except.c) */
+/* Used to cache "terminate", "unexpected", "set_terminate", and
+ "set_unexpected" after default_conversion. (lib-except.c) */
static tree Terminate, Unexpected, SetTerminate, SetUnexpected, CatchMatch;
-/* used to cache __find_first_exception_table_match ()
- for throw (lib-except.c) */
+/* Used to cache __find_first_exception_table_match for throw. */
static tree FirstExceptionMatch;
-/* used to cache a call to __unwind_function () (lib-except.c) */
+/* Used to cache a call to __unwind_function. */
static tree Unwind;
-/* holds a ready to emit call to "terminate ()". */
+/* Holds a ready to emit call to "terminate". */
static tree TerminateFunctionCall;
static tree empty_fndecl;
@@ -245,8 +244,8 @@ init_exception_processing ()
tree PFV = build_pointer_type (build_function_type
(void_type_node, void_list_node));
- /* arg list for the build_function_type call for set_terminate () and
- set_unexpected () */
+ /* Arg list for the build_function_type call for set_terminate and
+ set_unexpected. */
tree pfvlist = tree_cons (NULL_TREE, PFV, void_list_node);
/* void (*pfvtype (void (*) ()))() */
@@ -343,6 +342,10 @@ init_exception_processing ()
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_in_catch = lookup_name (get_identifier ("__eh_in_catch"), 0);
+
+ /* If we use setjmp/longjmp EH, arrange for all cleanup actions to
+ be protected with __terminate. */
+ protect_cleanup_actions_with_terminate = 1;
}
/* Build a type value for use at runtime for a type that is matched
@@ -448,6 +451,8 @@ expand_start_catch_block (declspecs, declarator)
false_label_rtx = gen_label_rtx ();
push_label_entry (&false_label_stack, false_label_rtx, NULL_TREE);
+ emit_line_note (input_filename, lineno);
+
if (declspecs)
{
tree exp;
@@ -460,8 +465,11 @@ expand_start_catch_block (declspecs, declarator)
{
error ("invalid catch parameter");
- /* This is cheap, but we want to maintain the data structures. */
+ /* This is cheap, but we want to maintain the data
+ structures. */
+
expand_eh_region_start ();
+
return;
}
@@ -513,11 +521,17 @@ expand_start_catch_block (declspecs, declarator)
emit_move_insn (DECL_RTL (saved_in_catch), const1_rtx);
- /* Because we are reordered out of line, we arrange
- to rethrow in the outer context, should we encounter
- an exception in the catch handler.
+ /* If we are not doing setjmp/longjmp EH, because we are reordered
+ out of line, we arrange to rethrow in the outer context so as to
+ skip through the terminate region we are nested in, should we
+ encounter an exception in the catch handler.
- Matches the end in expand_end_catch_block (). */
+ If we are doing setjmp/longjmp EH, we need to skip through the EH
+ object cleanup region. This isn't quite right, as we really need
+ to clean the object up, but we cannot do that until we track
+ multiple EH objects.
+
+ Matches the end in expand_end_catch_block. */
expand_eh_region_start ();
emit_line_note (input_filename, lineno);
@@ -539,23 +553,42 @@ expand_end_catch_block ()
if (! doing_eh (1))
return;
- /* Fall to outside the try statement when done executing handler and
- we fall off end of handler. This is jump Lresume in the
- documentation. */
- expand_goto (top_label_entry (&caught_return_label_stack));
-
t = make_node (RTL_EXPR);
TREE_TYPE (t) = void_type_node;
RTL_EXPR_RTL (t) = const0_rtx;
TREE_SIDE_EFFECTS (t) = 1;
start_sequence_for_rtl_expr (t);
- expand_internal_throw (DECL_RTL (top_label_entry (&caught_return_label_stack)));
+
+ if (exceptions_via_longjmp)
+ {
+ /* If we are doing setjmp/longjmp EH, we need to skip through
+ the EH object cleanup region. This isn't quite right, as we
+ really need to clean the object up, but we cannot do that
+ until we track multiple EH objects. */
+
+ emit_library_call (sjpopnthrow_libfunc, 0, VOIDmode, 0);
+ emit_barrier ();
+ }
+ else
+ {
+ /* If we are not doing setjmp/longjmp EH, we need an extra
+ region around the whole catch block to skip through the
+ terminate region we are nested in. */
+
+ expand_internal_throw (DECL_RTL (top_label_entry (&caught_return_label_stack)));
+ }
+
RTL_EXPR_SEQUENCE (t) = get_insns ();
end_sequence ();
- /* Matches the start in expand_start_catch_block (). */
+ /* Matches the start in expand_start_catch_block. */
expand_eh_region_end (t);
+ /* Fall to outside the try statement when done executing handler and
+ we fall off end of handler. This is jump Lresume in the
+ documentation. */
+ expand_goto (top_label_entry (&caught_return_label_stack));
+
expand_leftover_cleanups ();
/* Cleanup the EH parameter. */
@@ -580,7 +613,7 @@ do_unwind (inner_throw_label)
rtx return_val_rtx;
rtx temp;
- /* call to __builtin_return_address () */
+ /* Call to __builtin_return_address. */
params = tree_cons (NULL_TREE, integer_zero_node, NULL_TREE);
fcall = build_function_call (BuiltinReturnAddress, params);
return_val_rtx = expand_expr (fcall, NULL_RTX, Pmode, 0);
@@ -633,7 +666,7 @@ do_unwind (inner_throw_label)
#if 0
/* I would like to do this here, but the move below doesn't seem to work. */
- /* call to __builtin_return_address () */
+ /* Call to __builtin_return_address. */
params = tree_cons (NULL_TREE, integer_zero_node, NULL_TREE);
fcall = build_function_call (BuiltinReturnAddress, params);
return_val_rtx = expand_expr (fcall, NULL_RTX, Pmode, 0);
@@ -651,7 +684,7 @@ do_unwind (inner_throw_label)
}
-/* is called from expand_exception_blocks () to generate the code in a function
+/* Is called from expand_exception_blocks to generate the code in a function
to "throw" if anything in the function needs to perform a throw.
expands "throw" as the following pseudo code:
@@ -731,7 +764,7 @@ expand_builtin_throw ()
/* code to deal with unwinding and looking for it again */
emit_label (gotta_rethrow_it);
- /* call to __builtin_return_address () */
+ /* Call to __builtin_return_address. */
#if defined (ARM_FRAME_RTX) /* was __arm */
/* This should be moved into arm.h:RETURN_ADDR_RTX */
/* This replaces a 'call' to __builtin_return_address */
@@ -743,7 +776,7 @@ expand_builtin_throw ()
return_val_rtx = expand_expr (fcall, NULL_RTX, Pmode, 0);
#endif
- /* did __builtin_return_address () return a valid address? */
+ /* Did __builtin_return_address return a valid address? */
emit_cmp_insn (return_val_rtx, const0_rtx, EQ, NULL_RTX,
GET_MODE (return_val_rtx), 0, 0);
@@ -837,6 +870,7 @@ expand_end_eh_spec (raises)
do_function_call (Unexpected, NULL_TREE, NULL_TREE);
assemble_external (TREE_OPERAND (Unexpected, 0));
emit_barrier ();
+
expand_eh_region_end (second_try);
emit_label (check);
@@ -890,7 +924,6 @@ expand_exception_blocks ()
funcend = gen_label_rtx ();
emit_jump (funcend);
- /* expand_null_return (); */
start_sequence ();
@@ -931,12 +964,22 @@ expand_exception_blocks ()
if (insns)
{
- /* Is this necessary? */
- assemble_external (TREE_OPERAND (Terminate, 0));
+ /* We cannot protect n regions this way if we must flow into the
+ EH region through the top of the region, as we have to with
+ the setjmp/longjmp approach. */
+ if (exceptions_via_longjmp == 0)
+ {
+ /* Is this necessary? */
+ assemble_external (TREE_OPERAND (Terminate, 0));
+
+ expand_eh_region_start ();
+ }
- expand_eh_region_start ();
emit_insns (insns);
- expand_eh_region_end (TerminateFunctionCall);
+
+ if (exceptions_via_longjmp == 0)
+ expand_eh_region_end (TerminateFunctionCall);
+
expand_leftover_cleanups ();
}
@@ -1125,13 +1168,18 @@ expand_throw (exp)
/* This part is easy, as we don't have to do anything else. */
}
- /* This is the label that represents where in the code we were, when
- we got an exception. This needs to be updated when we rethrow an
- exception, so that the matching routine knows to search out. */
- label = gen_label_rtx ();
- emit_label (label);
+ if (exceptions_via_longjmp)
+ emit_throw ();
+ else
+ {
+ /* This is the label that represents where in the code we were, when
+ we got an exception. This needs to be updated when we rethrow an
+ exception, so that the matching routine knows to search out. */
+ label = gen_label_rtx ();
+ emit_label (label);
- expand_internal_throw (label);
+ expand_internal_throw (label);
+ }
}
/* Build a throw expression. */
diff --git a/gcc/cp/exception.cc b/gcc/cp/exception.cc
index 8cf227a719a..5d9503fac54 100644
--- a/gcc/cp/exception.cc
+++ b/gcc/cp/exception.cc
@@ -30,22 +30,23 @@
#include "typeinfo"
#include "exception"
-/* terminate (), unexpected (), set_terminate (), set_unexpected () as
- well as the default terminate func and default unexpected func */
+/* Define terminate, unexpected, set_terminate, set_unexpected as
+ well as the default terminate func and default unexpected func. */
+
+extern terminate_handler __terminate_func;
void
-__default_terminate ()
+terminate ()
{
- abort ();
+ __terminate_func ();
}
void
__default_unexpected ()
{
- __default_terminate ();
+ terminate ();
}
-static terminate_handler __terminate_func = __default_terminate;
static unexpected_handler __unexpected_func = __default_unexpected;
terminate_handler
@@ -67,12 +68,6 @@ set_unexpected (unexpected_handler func)
}
void
-terminate ()
-{
- __terminate_func ();
-}
-
-void
unexpected ()
{
__unexpected_func ();
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 4e1785d8ec9..332679d9857 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA. */
#include "cp-tree.h"
#include "flags.h"
#include "output.h"
+#include "except.h"
/* In C++, structures with well-defined constructors are initialized by
those constructors, unasked. CURRENT_BASE_INIT_LIST
@@ -39,8 +40,6 @@ Boston, MA 02111-1307, USA. */
line. Perhaps this was not intended. */
tree current_base_init_list, current_member_init_list;
-extern tree cleanups_this_call;
-
void emit_base_init ();
void check_base_init ();
static void expand_aggr_vbase_init ();
@@ -153,13 +152,8 @@ perform_member_init (member, name, init, explicit)
{
tree decl;
tree type = TREE_TYPE (member);
- extern int temp_slot_level;
- extern int target_temp_slot_level;
- tree old_cleanups = cleanups_this_call;
- int old_temp_level = target_temp_slot_level;
- push_temp_slots ();
- push_temp_slots ();
- target_temp_slot_level = temp_slot_level;
+
+ expand_start_target_temps ();
if (TYPE_NEEDS_CONSTRUCTING (type)
|| (init && TYPE_HAS_CONSTRUCTOR (type)))
@@ -219,15 +213,8 @@ perform_member_init (member, name, init, explicit)
expand_expr_stmt (build_modify_expr (decl, INIT_EXPR, init));
}
}
- expand_cleanups_to (old_cleanups);
- pop_temp_slots ();
- pop_temp_slots ();
- target_temp_slot_level = old_temp_level;
- /* There might something left from building the trees. */
- if (cleanups_this_call)
- {
- expand_cleanups_to (NULL_TREE);
- }
+
+ expand_end_target_temps ();
free_temp_slots ();
if (TYPE_NEEDS_DESTRUCTOR (type))
@@ -589,27 +576,14 @@ emit_base_init (t, immediately)
if (init != void_list_node)
{
- extern int temp_slot_level;
- extern int target_temp_slot_level;
- tree old_cleanups = cleanups_this_call;
- int old_temp_level = target_temp_slot_level;
- push_temp_slots ();
- push_temp_slots ();
- target_temp_slot_level = temp_slot_level;
+ expand_start_target_temps ();
member = convert_pointer_to_real (base_binfo, current_class_ptr);
expand_aggr_init_1 (base_binfo, NULL_TREE,
build_indirect_ref (member, NULL_PTR), init,
BINFO_OFFSET_ZEROP (base_binfo), LOOKUP_NORMAL);
- expand_cleanups_to (old_cleanups);
- pop_temp_slots ();
- pop_temp_slots ();
- target_temp_slot_level = old_temp_level;
- /* There might something left from building the trees. */
- if (cleanups_this_call)
- {
- expand_cleanups_to (NULL_TREE);
- }
+
+ expand_end_target_temps ();
free_temp_slots ();
}
@@ -796,28 +770,14 @@ expand_aggr_vbase_init_1 (binfo, exp, addr, init_list)
tree init = purpose_member (binfo, init_list);
tree ref = build_indirect_ref (addr, NULL_PTR);
- extern int temp_slot_level;
- extern int target_temp_slot_level;
- tree old_cleanups = cleanups_this_call;
- int old_temp_level = target_temp_slot_level;
- push_temp_slots ();
- push_temp_slots ();
- target_temp_slot_level = temp_slot_level;
+ expand_start_target_temps ();
if (init)
init = TREE_VALUE (init);
/* Call constructors, but don't set up vtables. */
expand_aggr_init_1 (binfo, exp, ref, init, 0, LOOKUP_COMPLAIN);
- expand_cleanups_to (old_cleanups);
- pop_temp_slots ();
- pop_temp_slots ();
- target_temp_slot_level = old_temp_level;
- /* There might something left from building the trees. */
- if (cleanups_this_call)
- {
- expand_cleanups_to (NULL_TREE);
- }
+ expand_end_target_temps ();
free_temp_slots ();
}
@@ -3109,20 +3069,22 @@ expand_vec_init (decl, base, maxindex, init, from_array)
push_obstacks_nochange ();
resume_temporary_allocation ();
{
- tree e1, e2 = make_node (RTL_EXPR);
- TREE_TYPE (e2) = void_type_node;
- RTL_EXPR_RTL (e2) = const0_rtx;
- TREE_SIDE_EFFECTS (e2) = 1;
- start_sequence_for_rtl_expr (e2);
+ tree e1, cleanup = make_node (RTL_EXPR);
+ TREE_TYPE (cleanup) = void_type_node;
+ RTL_EXPR_RTL (cleanup) = const0_rtx;
+ TREE_SIDE_EFFECTS (cleanup) = 1;
+ start_sequence_for_rtl_expr (cleanup);
e1 = build_array_eh_cleanup
(rval,
build_binary_op (MINUS_EXPR, maxindex, iterator, 1),
type);
expand_expr (e1, const0_rtx, VOIDmode, 0);
- RTL_EXPR_SEQUENCE (e2) = get_insns ();
+ RTL_EXPR_SEQUENCE (cleanup) = get_insns ();
end_sequence ();
- expand_eh_region_end (e2);
+
+ cleanup = protect_with_terminate (cleanup);
+ expand_eh_region_end (cleanup);
}
pop_obstacks ();
}
diff --git a/gcc/cp/lang-options.h b/gcc/cp/lang-options.h
index ed76bcf349f..f2014c6a769 100644
--- a/gcc/cp/lang-options.h
+++ b/gcc/cp/lang-options.h
@@ -70,8 +70,6 @@ Boston, MA 02111-1307, USA. */
"-fno-repo",
"-fsave-memoized",
"-fno-save-memoized",
- "-fshort-temps",
- "-fno-short-temps",
"-fstats",
"-fno-stats",
"-fstrict-prototype",
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index a9dd9d5de8e..358e24a9469 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1698,7 +1698,7 @@ make_thunk (function, delta)
}
if (thunk == NULL_TREE)
{
- thunk = build_decl (FUNCTION_DECL, thunk_id, TREE_TYPE (func_decl));
+ thunk = build_lang_decl (FUNCTION_DECL, thunk_id, TREE_TYPE (func_decl));
DECL_RESULT (thunk)
= build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (TREE_TYPE (vtable_entry_type)));
TREE_READONLY (thunk) = TYPE_READONLY (TREE_TYPE (vtable_entry_type));
@@ -1719,27 +1719,9 @@ void
emit_thunk (thunk_fndecl)
tree thunk_fndecl;
{
- rtx insns;
- char buffer[250];
- tree argp;
- struct args_size stack_args_size;
tree function = TREE_OPERAND (DECL_INITIAL (thunk_fndecl), 0);
int delta = THUNK_DELTA (thunk_fndecl);
char *fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
- int tem;
- int failure = 0;
- int save_ofp;
-
- /* Used to remember which regs we need to emit a USE rtx for. */
- rtx need_use[FIRST_PSEUDO_REGISTER];
- int need_use_count = 0;
-
- /* rtx for the 'this' parameter. */
- rtx this_rtx = 0, this_reg_rtx = 0, fixed_this_rtx;
-
- char *(*save_decl_printable_name) () = decl_printable_name;
- /* Data on reg parms scanned so far. */
- CUMULATIVE_ARGS args_so_far;
if (TREE_ASM_WRITTEN (thunk_fndecl))
return;
@@ -1749,203 +1731,58 @@ emit_thunk (thunk_fndecl)
TREE_ADDRESSABLE (function) = 1;
mark_used (function);
- decl_printable_name = thunk_printable_name;
if (current_function_decl)
abort ();
- current_function_decl = thunk_fndecl;
TREE_SET_CODE (thunk_fndecl, FUNCTION_DECL);
+
#ifdef ASM_OUTPUT_MI_THUNK
+ current_function_decl = thunk_fndecl;
temporary_allocation ();
assemble_start_function (thunk_fndecl, fnname);
ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function);
assemble_end_function (thunk_fndecl, fnname);
permanent_allocation (1);
-#else
- save_ofp = flag_omit_frame_pointer;
- flag_omit_frame_pointer = 1;
- init_function_start (thunk_fndecl, input_filename, lineno);
- pushlevel (0);
- expand_start_bindings (1);
-
- temporary_allocation ();
-
- /* Start updating where the next arg would go. */
- INIT_CUMULATIVE_ARGS (args_so_far, TREE_TYPE (function), NULL_RTX, 0);
- stack_args_size.constant = 0;
- stack_args_size.var = 0;
- /* SETUP for possible structure return address FIXME */
-
- /* Now look through all the parameters, make sure that we
- don't clobber any registers used for parameters.
- Also, pick up an rtx for the first "this" parameter. */
- for (argp = TYPE_ARG_TYPES (TREE_TYPE (function));
- argp != NULL_TREE;
- argp = TREE_CHAIN (argp))
-
- {
- tree passed_type = TREE_VALUE (argp);
- register rtx entry_parm;
- int named = 1; /* FIXME */
- struct args_size stack_offset;
- struct args_size arg_size;
-
- if (passed_type == void_type_node)
- break;
-
- if ((TREE_CODE (TYPE_SIZE (passed_type)) != INTEGER_CST
- && contains_placeholder_p (TYPE_SIZE (passed_type)))
-#ifdef FUNCTION_ARG_PASS_BY_REFERENCE
- || FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far,
- TYPE_MODE (passed_type),
- passed_type, named)
-#endif
- )
- passed_type = build_pointer_type (passed_type);
-
- entry_parm = FUNCTION_ARG (args_so_far,
- TYPE_MODE (passed_type),
- passed_type,
- named);
- if (entry_parm != 0)
- need_use[need_use_count++] = entry_parm;
-
- locate_and_pad_parm (TYPE_MODE (passed_type), passed_type,
-#ifdef STACK_PARMS_IN_REG_PARM_AREA
- 1,
-#else
- entry_parm != 0,
-#endif
- thunk_fndecl,
- &stack_args_size, &stack_offset, &arg_size);
-
-/* REGNO (entry_parm);*/
- if (this_rtx == 0)
- {
- this_reg_rtx = entry_parm;
- if (!entry_parm)
- {
- rtx offset_rtx = ARGS_SIZE_RTX (stack_offset);
-
- rtx internal_arg_pointer, stack_parm;
-
- if ((ARG_POINTER_REGNUM == STACK_POINTER_REGNUM
- || ! (fixed_regs[ARG_POINTER_REGNUM]
- || ARG_POINTER_REGNUM == FRAME_POINTER_REGNUM)))
- internal_arg_pointer = copy_to_reg (virtual_incoming_args_rtx);
- else
- internal_arg_pointer = virtual_incoming_args_rtx;
-
- if (offset_rtx == const0_rtx)
- entry_parm = gen_rtx (MEM, TYPE_MODE (passed_type),
- internal_arg_pointer);
- else
- entry_parm = gen_rtx (MEM, TYPE_MODE (passed_type),
- gen_rtx (PLUS, Pmode,
- internal_arg_pointer,
- offset_rtx));
- }
-
- this_rtx = entry_parm;
- }
-
- FUNCTION_ARG_ADVANCE (args_so_far,
- TYPE_MODE (passed_type),
- passed_type,
- named);
- }
-
- fixed_this_rtx = plus_constant (this_rtx, delta);
- if (this_rtx != fixed_this_rtx)
- emit_move_insn (this_rtx, fixed_this_rtx);
-
- if (this_reg_rtx)
- emit_insn (gen_rtx (USE, VOIDmode, this_reg_rtx));
-
- emit_indirect_jump (XEXP (DECL_RTL (function), 0));
-
- while (need_use_count > 0)
- emit_insn (gen_rtx (USE, VOIDmode, need_use[--need_use_count]));
-
- expand_end_bindings (NULL, 1, 0);
- poplevel (0, 0, 1);
-
- /* From now on, allocate rtl in current_obstack, not in saveable_obstack.
- Note that that may have been done above, in save_for_inline_copying.
- The call to resume_temporary_allocation near the end of this function
- goes back to the usual state of affairs. */
-
- rtl_in_current_obstack ();
-
- insns = get_insns ();
-
- /* Copy any shared structure that should not be shared. */
-
- unshare_all_rtl (insns);
-
- /* Instantiate all virtual registers. */
-
- instantiate_virtual_regs (current_function_decl, get_insns ());
-
- /* We are no longer anticipating cse in this function, at least. */
-
- cse_not_expected = 1;
-
- /* Now we choose between stupid (pcc-like) register allocation
- (if we got the -noreg switch and not -opt)
- and smart register allocation. */
-
- if (optimize > 0) /* Stupid allocation probably won't work */
- obey_regdecls = 0; /* if optimizations being done. */
-
- regclass_init ();
-
- regclass (insns, max_reg_num ());
- if (obey_regdecls)
- {
- stupid_life_analysis (insns, max_reg_num (), NULL);
- failure = reload (insns, 0, NULL);
- }
- else
- {
- /* Do control and data flow analysis,
- and write some of the results to dump file. */
-
- flow_analysis (insns, max_reg_num (), NULL);
- local_alloc ();
- failure = global_alloc (NULL);
- }
-
- reload_completed = 1;
-
-#ifdef LEAF_REGISTERS
- leaf_function = 0;
- if (optimize > 0 && only_leaf_regs_used () && leaf_function_p ())
- leaf_function = 1;
-#endif
-
- /* If a machine dependent reorganization is needed, call it. */
-#ifdef MACHINE_DEPENDENT_REORG
- MACHINE_DEPENDENT_REORG (insns);
-#endif
-
- /* Now turn the rtl into assembler code. */
-
- assemble_start_function (thunk_fndecl, fnname);
- final (insns, asm_out_file, optimize, 0);
- assemble_end_function (thunk_fndecl, fnname);
-
- reload_completed = 0;
-
- /* Cancel the effect of rtl_in_current_obstack. */
+ current_function_decl = 0;
+#else /* ASM_OUTPUT_MI_THUNK */
+ if (varargs_function_p (function))
+ cp_error ("generic thunk code does not work for variadic function `%#D'",
+ function);
+ {
+ tree a, t;
- permanent_allocation (1);
- flag_omit_frame_pointer = save_ofp;
+ /* Set up clone argument trees for the thunk. */
+ t = NULL_TREE;
+ for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a))
+ {
+ tree x = copy_node (a);
+ TREE_CHAIN (x) = t;
+ DECL_CONTEXT (x) = thunk_fndecl;
+ t = x;
+ }
+ a = nreverse (t);
+ DECL_ARGUMENTS (thunk_fndecl) = a;
+ DECL_RESULT (thunk_fndecl) = NULL_TREE;
+
+ start_function (NULL_TREE, thunk_fndecl, NULL_TREE, 1);
+ store_parm_decls ();
+
+ /* Build up the call to the real function. */
+ t = build_int_2 (delta, -1 * (delta < 0));
+ TREE_TYPE (t) = signed_type (sizetype);
+ t = fold (build (PLUS_EXPR, TREE_TYPE (a), a, t));
+ t = tree_cons (NULL_TREE, t, NULL_TREE);
+ for (a = TREE_CHAIN (a); a; a = TREE_CHAIN (a))
+ t = tree_cons (NULL_TREE, a, t);
+ t = nreverse (t);
+ t = build_call (function, TREE_TYPE (TREE_TYPE (function)), t);
+ c_expand_return (t);
+
+ finish_function (lineno, 0, 0);
+ }
#endif /* ASM_OUTPUT_MI_THUNK */
- TREE_SET_CODE (thunk_fndecl, THUNK_DECL);
- decl_printable_name = save_decl_printable_name;
- current_function_decl = 0;
+ TREE_SET_CODE (thunk_fndecl, THUNK_DECL);
}
/* Code for synthesizing methods which have default semantics defined. */
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index d0a6c7644ef..7850be9b364 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -132,6 +132,9 @@ process_template_parm (list, next)
error (" a template type parameter must begin with `class' or `typename'");
TREE_TYPE (parm) = void_type_node;
}
+ else if (pedantic && TREE_CODE (TREE_TYPE (parm)) == REAL_TYPE)
+ cp_pedwarn ("`%T' is not a valid type for a template constant parameter",
+ TREE_TYPE (parm));
tinfo = make_node (TEMPLATE_CONST_PARM);
my_friendly_assert (TREE_PERMANENT (tinfo), 260.5);
if (TREE_PERMANENT (parm) == 0)
diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c
index 90deea77c20..49c64d70de4 100644
--- a/gcc/cp/spew.c
+++ b/gcc/cp/spew.c
@@ -299,11 +299,9 @@ yylex ()
case SELFNAME:
lastiddecl = identifier_typedecl_value (tmp_token.yylval.ttype);
if (lastiddecl != trrr)
- {
- lastiddecl = trrr;
- if (got_scope)
- tmp_token.yylval.ttype = trrr;
- }
+ lastiddecl = trrr;
+ if (got_scope)
+ tmp_token.yylval.ttype = trrr;
break;
case IDENTIFIER:
lastiddecl = trrr;
diff --git a/gcc/cp/tinfo2.cc b/gcc/cp/tinfo2.cc
index 10290a8e52b..72870df9538 100644
--- a/gcc/cp/tinfo2.cc
+++ b/gcc/cp/tinfo2.cc
@@ -43,7 +43,7 @@ fast_compare (const char *n1, const char *n2) {
};
bool
-type_info::before (const type_info &arg)
+type_info::before (const type_info &arg) const
{
return fast_compare (name (), arg.name ()) < 0;
}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index aefce65b2cb..de9128fd7f5 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -108,6 +108,8 @@ real_lvalue_p (ref)
return 0;
}
+/* This differs from real_lvalue_p in that class rvalues are considered
+ lvalues. */
int
lvalue_p (ref)
tree ref;
@@ -2102,3 +2104,16 @@ error_type (arg)
return type;
}
+
+/* Does FUNCTION use a variable-length argument list? */
+
+int
+varargs_function_p (function)
+ tree function;
+{
+ tree parm = TYPE_ARG_TYPES (TREE_TYPE (function));
+ for (; parm; parm = TREE_CHAIN (parm))
+ if (TREE_VALUE (parm) == void_type_node)
+ return 0;
+ return 1;
+}
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index a734c01344a..97b6fbad834 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1507,7 +1507,7 @@ decay_conversion (exp)
inner = build1 (CONVERT_EXPR,
build_pointer_type (TREE_TYPE (TREE_TYPE (inner))),
inner);
- TREE_REFERENCE_EXPR (inner) = 1;
+ TREE_CONSTANT (inner) = TREE_CONSTANT (TREE_OPERAND (inner, 0));
}
return convert (build_pointer_type (TREE_TYPE (type)), inner);
}
@@ -4261,8 +4261,10 @@ build_unary_op (code, xarg, noconvert)
argtype = TREE_TYPE (arg);
if (TREE_CODE (argtype) == REFERENCE_TYPE)
{
- arg = build1 (CONVERT_EXPR, build_pointer_type (TREE_TYPE (TREE_TYPE (arg))), arg);
- TREE_REFERENCE_EXPR (arg) = 1;
+ arg = build1
+ (CONVERT_EXPR,
+ build_pointer_type (TREE_TYPE (TREE_TYPE (arg))), arg);
+ TREE_CONSTANT (arg) = TREE_CONSTANT (TREE_OPERAND (arg, 0));
return arg;
}
else if (pedantic
@@ -4283,16 +4285,12 @@ build_unary_op (code, xarg, noconvert)
if (arg == current_class_ref)
return current_class_ptr;
- /* Keep `default_conversion' from converting if
- ARG is of REFERENCE_TYPE. */
arg = TREE_OPERAND (arg, 0);
if (TREE_CODE (TREE_TYPE (arg)) == REFERENCE_TYPE)
{
- if (TREE_CODE (arg) == VAR_DECL && DECL_INITIAL (arg)
- && !TREE_SIDE_EFFECTS (DECL_INITIAL (arg)))
- arg = DECL_INITIAL (arg);
- arg = build1 (CONVERT_EXPR, build_pointer_type (TREE_TYPE (TREE_TYPE (arg))), arg);
- TREE_REFERENCE_EXPR (arg) = 1;
+ arg = build1
+ (CONVERT_EXPR,
+ build_pointer_type (TREE_TYPE (TREE_TYPE (arg))), arg);
TREE_CONSTANT (arg) = TREE_CONSTANT (TREE_OPERAND (arg, 0));
}
else if (lvalue_p (arg))
@@ -7148,6 +7146,8 @@ c_expand_return (retval)
if (TREE_CODE (whats_returned) == ADDR_EXPR)
whats_returned = TREE_OPERAND (whats_returned, 0);
}
+ if (TREE_CODE (whats_returned) == CONVERT_EXPR)
+ whats_returned = TREE_OPERAND (whats_returned, 0);
if (TREE_CODE (whats_returned) == ADDR_EXPR)
{
whats_returned = TREE_OPERAND (whats_returned, 0);