+Thu Dec 15 16:32:12 1994 Mike Stump <mrs@cygnus.com>
+
+ * decl2.c (check_classfn): Use decls_match to check if this has
+ already been declared, as the DECL_ASSEMBLER_NAME may have been
+ changed via asm("new_name").
+ * decl.c (decls_match): Make public.
+
+Thu Dec 15 15:17:55 1994 Mike Stump <mrs@cygnus.com>
+
+ * *.[chy] (expand_aggr_init) Add fourth argument to handle
+ distinction between = init and (init) style of initializations.
+ * *.[chy] (finish_decl): Add fifth argument to to handle
+ distinction between = init and (init) style of initializations.
+
+Tue Dec 13 19:16:05 1994 Mike Stump <mrs@cygnus.com>
+
+ Fix some random `explicit' bugs.
+
+ * cvt.c (convert_to_reference): Add third parameter to
+ convert_force.
+ (convert_force): Ditto.
+ * call.c (build_method_call): Ditto.
+ * decl2.c (setup_vtbl_ptr): Ditto.
+ * init.c (expand_virtual_init): Ditto.
+ (build_member_call): Ditto.
+ (build_delete): Ditto.
+ (build_vbase_delete): Ditto.
+ * typeck.c (build_component_addr): Ditto.
+ (build_c_cast): Ditto.
+ (build_modify_expr): Ditto.
+ * cp-tree.h (CONV_NONCONVERTING): Ditto. Add so that we can
+ distinguish the context in which the conversion appears. Add thrid
+ argument to build_c_cast.
+ * cvt.c (cp_convert): Pass whether or not we want to consider
+ non-converting constructors down to build_method_call.
+ * decl2.c (reparse_absdcl_as_casts): Add third argument to
+ build_c_cast.
+ * gc.c (build_m_desc): Ditto.
+ * init.c (build_new): Ditto.
+ * parse.y (expr_no_commas): Ditto.
+ (primary): Ditto.
+ * typeck.c (build_x_function_call): Ditto.
+ (build_static_cast): Ditto.
+ (build_reinterpret_cast): Ditto.
+ (build_const_cast): Ditto.
+ (build_c_cast): Ditto.
+ (build_ptrmemfunc): Ditto.
+ * typeck2.c (build_functional_cast): Ditto.
+ * init.c (expand_aggr_init): Added LOOKUP_ONLYCONVERTING to
+ expand_aggr_init_1 as inits are converted to the destination type.
+
+Tue Dec 13 16:18:57 1994 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * Make-lang.in (cc1plus): Depends on c-pragma.o.
+
+ * Makefile.in (OBJ{DEP,}S): Add ../c-pragma.o.
+
+ * lex.c (check_newline): If the #pragma is not recognized by g++,
+ try machine-specific ones too.
+ (handle_sysv_pragma): Copied from c-lex.c.
+
+Mon Dec 12 23:53:06 1994 Mike Stump <mrs@cygnus.com>
+
+ * except.c (expand_throw): Fix Dec 6th change, build_new likes a
+ reference better.
+
+Mon Dec 12 18:01:00 1994 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * typeck.c (build_binary_op): Lose checks on TYPE_PTRMEMFUNC_P with
+ IS_AGGR_TYPE, since now they will not both be set on the same type.
+
+ * pt.c (do_pending_expansions): Don't clear TREE_PUBLIC on
+ instantiations controlled by -fexternal-templates.
+
+ * decl.c (duplicate_decls): Don't complain about different values of
+ __attribute__ ((const)) and ((noreturn)).
+
Fri Dec 9 18:17:37 1994 Doug Evans <dje@cygnus.com>
* Makefile.in (BISONFLAGS): Delete --yacc.
* Makefile.in (BISONFLAGS): Add --yacc so that output winds up in
y.tab.c.
+Thu Dec 8 17:39:46 1994 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * decl.c (finish_decl): Don't call obscure_complex_init for decls
+ of indeterminate size.
+
+Wed Dec 7 16:49:22 1994 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * decl.c (obscure_complex_init): Function to tweak the decl to
+ prevent expand_decl from tring to initialize it.
+ (finish_decl): Use it rather than writing the same code in three
+ different places.
+
+ * parse.y (bad_parm): Stop trying to support parms without types.
+
+Wed Dec 7 12:06:56 1994 Mike Stump <mrs@cygnus.com>
+
+ * decl2.c (grokfield): Make asm specs on static member functions
+ work.
+
+Tue Dec 6 15:43:20 1994 Mike Stump <mrs@cygnus.com>
+
+ * except.c (expand_throw): Make a copy of the thrown object.
+
+Tue Dec 6 14:16:34 1994 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * parse.y: : has lower precedence than =.
+
+Tue Dec 6 12:46:17 1994 Mike Stump <mrs@cygnus.com>
+
+ * decl.c (pushdecl): Use DECL_NAME of VAR_DECLs to avoid namespace
+ manglings.
+ (grokvardecl): Add namespace into variable name.
+
+Tue Dec 6 11:26:55 1994 Mike Stump <mrs@cygnus.com>
+
+ * decl2.c (current_namespace_id): New routine to transform a simple
+ name into a name in a namespace.
+ * decl.c (grokdeclarator): Use it.
+ * decl2.c (get_namespace_id): Find the name of the current
+ namespace.
+ (push_namespace, pop_namespace): Complete out missing
+ functionality.
+
+Mon Dec 5 17:11:51 1994 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * class.c (finish_struct): Don't use LONG_LONG_TYPE_SIZE, as it may
+ not be defined. Fix warning message for enums and restore warning
+ for non-enums.
+
+ * decl2.c (push_namespace): Dummy function.
+ (pop_namespace): Ditto.
+ (do_namespace_alias): Ditto.
+ (do_using_decl): Ditto.
+ (do_using_directive): Ditto.
+
+ * parse.y: New token NSNAME for namespace names.
+ (extdef): Add namespace, using definitions.
+ (using_decl): New rule for using declarations.
+ (any_id): New rule for identifiers with any degree of scoping.
+ (identifier): Add NSNAME.
+ (notype_identifier): Ditto.
+ (component_decl): Add using_decl.
+ (nested_name_specifier): Add NSNAME SCOPE.
+
+ * typeck.c (convert_for_assignment): Handle conversions between
+ enums and bool.
+
+ * decl.c (duplicate_decls): Only propagate DECL_MAIN_VARIANT on
+ FUNCTION_DECLs.
+
+Mon Dec 5 13:03:16 1994 Mike Stump <mrs@cygnus.com>
+
+ * class.c (finish_struct): Give an error if one tries to declare a
+ bit-field's size greater than a long long, as the backend will dump.
+ It is not an error to declare an enum bit-field greater than its
+ precision. Warn if an enum bit-field is too small to hold all
+ its values.
+
+Mon Dec 5 11:41:50 1994 Mike Stump <mrs@cygnus.com>
+
+ * typeck.c (convert_for_assignment): Use cp_convert instead of
+ convert so that we don't get static casts.
+
+Sun Dec 4 11:59:01 1994 Mike Stump <mrs@cygnus.com>
+
+ * cvt.c (cp_convert): Don't complain about int->enum conversion if
+ we are doing static casts.
+
+Fri Dec 2 18:32:41 1994 Mike Stump <mrs@cygnus.com>
+
+ * error.c (dump_expr): Do something more intelligent with SAVE_EXPRs
+ when dumping expressions in error messages.
+
+Fri Dec 2 17:04:27 1994 Mike Stump <mrs@cygnus.com>
+
+ * gc.c (build_dynamic_cast): Change interface to libg++, ensure that
+ the return type is the right type, and make references work.
+
+Fri Dec 2 16:36:43 1994 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * decl.c (poplevel): Don't be confused by function-scope
+ declarations of non-nested functions.
+ (duplicate_decls): Propagate DECL_MAIN_VARIANT.
+ (pushdecl): Use duplicate_decls to copy info from old decl into new
+ function-scope one rather than doing it here.
+
+ * decl2.c (mark_inline_for_output): Deal with the DECL_MAIN_VARIANT
+ of this decl, in case this is a function-scope declaration.
+
+ * decl.c (finish_enum): Make sure that the type has the right
+ precision when we call fixup_*_type.
+
+Tue Nov 29 19:12:07 1994 Jason Merrill <jason@phydeaux.cygnus.com>
+
+ * cvt.c (build_up_reference): Strip superfluous NOP_EXPRs; we do
+ want to build up references to rvalues if possible.
+ (cp_convert): Stick on a NOP_EXPR when converting to the same type.
+
+Tue Nov 29 11:28:59 1994 Mike Stump <mrs@cygnus.com>
+
+ * parse.y (maybe_raises): Handle throw ().
+ * parse.y (ansi_raise_identifier): grok type-ids in exception
+ specifications.
+ * tree.c (build_exception_variant): Use list compare to check if
+ two exception specifications match.
+ * decl.c (duplicate_decls, bad_specifiers): Enhance wording on error
+ messages.
+ * call.c (build_method_call): Remove TREE_RAISES.
+ * cvt.c (convert_to_aggr): Ditto.
+ * typeck.c (build_function_call_real, convert_arguments): Ditto.
+ * init.c (expand_aggr_init_1): Ditto.
+
+Tue Nov 29 09:50:39 1994 Mike Stump <mrs@cygnus.com>
+
+ * except.c: Add support for m68k and mips exception handling
+ support.
+
+Tue Nov 29 08:48:33 1994 Mike Stump <mrs@cygnus.com>
+
+ * except.c (expand_end_all_catch): Throw into outer context, if we
+ fall off end of catch handlers.
+
Mon Nov 28 16:44:41 1994 Mike Stump <mrs@cygnus.com>
* Makefile.in: Make is easier to decide where parse.[ch] will be
* decl.c (finish_decl): Also end temporary allocation if the decl in
question has a type of error_mark_node.
-Wed Sep 28 21:45:00 1994 Mike Stump (mrs@cygnus.com)
+Wed Sep 28 21:45:00 1994 Mike Stump <mrs@cygnus.com>
* typeck.c (build_modify_expr): When optimizing ?: on lhs, make sure
that if the ?: was a reference type, that the subparts will be also.
* error.c (cp_line_of): Use CLASSTYPE_SOURCE_LINE for aggregates.
* class.c (finish_struct): Set CLASSTYPE_SOURCE_LINE.
-Tue Aug 23 09:28:35 1994 Mike Stump (mrs@cygnus.com)
+Tue Aug 23 09:28:35 1994 Mike Stump <mrs@cygnus.com>
* error.c (dump_decl): Improve wording, so that error messages
dont't read template<, class foo>...
* method.c (build_overload_name): ditto.
* method.c (build_overload_identifier): ditto.
-Thu Aug 18 16:24:43 1994 Mike Stump (mrs@cygnus.com)
+Thu Aug 18 16:24:43 1994 Mike Stump <mrs@cygnus.com>
* error.c (dump_decl): Handle NULL args.
* g++.c: Include <sys/errno.h> in case `errno' is a macro
as permitted by ANSI C.
-Thu Aug 18 12:48:09 1994 Mike Stump (mrs@cygnus.com)
+Thu Aug 18 12:48:09 1994 Mike Stump <mrs@cygnus.com>
* class.c (finish_struct): Move setting of CLASSTYPE_INTERFACE and
CLASSTYPE_VTABLE_NEEDS_WRITING up to left_curly time.
(finish_function): Use DECL_DEFER_OUTPUT to decide which inlines to
mark for later consideration, rather than DECL_FUNCTION_MEMBER_P.
-Fri Aug 5 01:12:20 1994 Mike Stump (mrs@cygnus.com)
+Fri Aug 5 01:12:20 1994 Mike Stump <mrs@cygnus.com>
* class.c (get_class_offset_1, get_class_offset): New routine to
find the offset of the class where a virtual function is defined,
* decl.c (grok_reference_init): Always save the initializer of a
reference.
-Fri Jul 8 17:41:46 1994 Mike Stump (mrs@cygnus.com)
+Fri Jul 8 17:41:46 1994 Mike Stump <mrs@cygnus.com>
* decl.c (cplus_expand_expr_stmt): Wrap statement expressions inside
CLEANUP_POINT_EXPRs so that the stack slots can be reused.
(finish_vtable_vardecl): Call import_export_template before
import_export_vtable.
-Wed Jul 6 20:25:48 1994 Mike Stump (mrs@cygnus.com)
+Wed Jul 6 20:25:48 1994 Mike Stump <mrs@cygnus.com>
* except.c (init_exception_processing): Setup interim_eh_hook to
call lang_interim_eh.
* decl.c (grokdeclarator): If we are grokking an opaque typedef
in a signature, don't complain about it begin static.
-Wed Jun 29 16:44:45 1994 Mike Stump (mrs@cygnus.com)
+Wed Jun 29 16:44:45 1994 Mike Stump <mrs@cygnus.com>
Fixes a problem of the this pointer being wrong in virtual calls to
methods that are not overridden in more derived classes.
* typeck2.c (process_init_constructor): Don't treat empty_init_node
specially.
-Wed Jun 15 19:05:25 1994 Mike Stump (mrs@cygnus.com)
+Wed Jun 15 19:05:25 1994 Mike Stump <mrs@cygnus.com>
* class.c (override_one_vtable): Don't forget to merge in an old
overrider when we wanted to reuse a vtable, but couldn't.
(finish_file): Output all pending inlines if
flag_keep_inline_functions.
-Wed Jun 8 20:48:02 1994 Mike Stump (mrs@cygnus.com)
+Wed Jun 8 20:48:02 1994 Mike Stump <mrs@cygnus.com>
* tree.c (layout_vbasetypes): Align virtual base classes inside
complete objects, so that we don't core dump on machines such as
* typeck.c (convert_arguments): Make sure type is not NULL before
checking its TREE_CODE.
-Wed Jun 1 17:40:39 1994 Mike Stump (mrs@cygnus.com)
+Wed Jun 1 17:40:39 1994 Mike Stump <mrs@cygnus.com>
* class.c (get_derived_offset): New routine.
* class.c (finish_base_struct): Make sure we set BINFO_VTABLE and
* decl.c (grokdeclarator): Make sure we have a DNAME set before we
try to use it in an error.
-Wed Jun 1 09:48:49 1994 Mike Stump (mrs@cygnus.com)
+Wed Jun 1 09:48:49 1994 Mike Stump <mrs@cygnus.com>
* typeck.c (convert_arguments, convert_for_initialization): Don't
strip NOP_EXPRs, when we are converting to a reference.
* typeck.c (build_binary_op_nodefault): Division by constant zero is
an error.
-Fri May 27 13:50:15 1994 Mike Stump (mrs@cygnus.com)
+Fri May 27 13:50:15 1994 Mike Stump <mrs@cygnus.com>
* class.c (override_one_vtable): Don't modify things we don't own.
* class.c (finish_struct_bits): Set TYPE_HAS_INT_CONVERSION if it
has a conversion to enum or bool, too.
-Fri May 13 16:31:27 1994 Mike Stump (mrs@cygnus.com)
+Fri May 13 16:31:27 1994 Mike Stump <mrs@cygnus.com>
* method.c (emit_thunk): Make declaration for
current_call_is_indirect local (needed for hppa).
* pt.c (uses_template_parms): Grok BOOLEAN_TYPE.
(tsubst): Ditto.
-Fri May 13 16:23:32 1994 Mike Stump (mrs@cygnus.com)
+Fri May 13 16:23:32 1994 Mike Stump <mrs@cygnus.com>
* pt.c (tsubst): If there is already a function for this expansion,
use it.
* cp-tree.h (build_static_cast, build_reinterpret_cast,
build_const_cast): Add declarations.
-Fri May 13 09:50:31 1994 Mike Stump (mrs@cygnus.com)
+Fri May 13 09:50:31 1994 Mike Stump <mrs@cygnus.com>
* search.c (expand_indirect_vtbls_init): Fix breakage from Apr 27
fix. We now try get_binfo, and if that doesn't find what we want,
(build_default_unary_type_conversion): Convert arg of ! to bool.
(type_promotes_to): bool promotes to int.
-Fri May 13 01:43:18 1994 Mike Stump (mrs@cygnus.com)
+Fri May 13 01:43:18 1994 Mike Stump <mrs@cygnus.com>
Implement the new builtin `bool' type.
* typeck.c (build_binary_op_nodefault): Convert args of && and || to
* g++.c: Use #ifdef for __MSDOS__, not #if.
-Thu May 12 18:05:18 1994 Mike Stump (mrs@cygnus.com)
+Thu May 12 18:05:18 1994 Mike Stump <mrs@cygnus.com>
* decl2.c (lang_f_options): Handle -fshort-temps. -fshort-temps
gives old behavior , and destroys temporaries earlier. Default
* init.c (emit_base_init): Check if there's a DECL_NAME on the
member before trying to do an initialization for it.
-Tue May 10 11:34:37 1994 Mike Stump (mrs@cygnus.com)
+Tue May 10 11:34:37 1994 Mike Stump <mrs@cygnus.com>
* except.c: Don't do anything useful when cross compiling.
* decl.c (poplevel): Always call poplevel recursively if we're
dealing with a temporary binding level.
-Sat May 7 10:52:28 1994 Mike Stump (mrs@cygnus.com)
+Sat May 7 10:52:28 1994 Mike Stump <mrs@cygnus.com>
* decl.c (finish_decl): Make sure we run cleanups for initial values
of decls. Cures memory leak.
* cp/decl.c (finish_decl): Setting asmspec_tree should not
zero out the old RTL.
-Fri May 6 01:25:38 1994 Mike Stump (mrs@cygnus.com)
+Fri May 6 01:25:38 1994 Mike Stump <mrs@cygnus.com>
Add alpha exception handling support to the compiler.
Quick and dirty backend in except.c.
* typeck2.c (build_functional_cast): Don't look for a function call
interpretation.
-Thu Apr 28 15:19:46 1994 Mike Stump (mrs@cygnus.com)
+Thu Apr 28 15:19:46 1994 Mike Stump <mrs@cygnus.com>
* cp-tree.h: disable use of backend EH.
* call.c (build_overload_call_real): Don't take the single-function
shortcut if we're dealing with an overloaded operator.
-Wed Apr 27 17:35:37 1994 Mike Stump (mrs@cygnus.com)
+Wed Apr 27 17:35:37 1994 Mike Stump <mrs@cygnus.com>
* search.c (get_base_distance): Search the virtual base class
binfos, incase someone wants to convert to a real virtual base
* typeck.c (build_unary_op): References are too lvalues.
-Wed Apr 27 13:58:05 1994 Mike Stump (mrs@cygnus.com)
+Wed Apr 27 13:58:05 1994 Mike Stump <mrs@cygnus.com>
* class.c (override_one_vtable): We have to prepare_fresh_vtable
before we modify it, not after, also, we cannot reuse an old vtable,
* decl.c (grokdeclarator): Don't bash references to arrays into
references to pointers in function parms. Use type_promotes_to.
-Tue Apr 26 23:44:36 1994 Mike Stump (mrs@cygnus.com)
+Tue Apr 26 23:44:36 1994 Mike Stump <mrs@cygnus.com>
Finish off Apr 19th work.
* lex.c (process_next_inline): Don't muck with DECL_INLINE.
(do_pending_inlines): Ditto.
-Tue Apr 19 22:25:41 1994 Mike Stump (mrs@cygnus.com)
+Tue Apr 19 22:25:41 1994 Mike Stump <mrs@cygnus.com>
Reimplement vtable building, and most vtable pointer setting.
Allows for earier maintenance, easier understandability, and most
* decl.c (lookup_name): When called from the lexer, look at
got_scope and looking_at_typename; otherwise don't.
-Thu Apr 7 22:05:47 1994 Mike Stump (mrs@cygnus.com)
+Thu Apr 7 22:05:47 1994 Mike Stump <mrs@cygnus.com>
31th Cygnus<->FSF merge.
* typeck.c (compparms): Also allow t1 to be ... if strict == 0.
-Thu Apr 7 16:17:50 1994 Mike Stump (mrs@cygnus.com)
+Thu Apr 7 16:17:50 1994 Mike Stump <mrs@cygnus.com>
* class.c (build_vtable_entry): Fix breakage introduced Apr 5
17:48:41.
instead. (The rationale is that these optimizations both break binary
compatibility, but should become the default in a future release.)
-Wed Apr 6 10:53:56 1994 Mike Stump (mrs@cygnus.com)
+Wed Apr 6 10:53:56 1994 Mike Stump <mrs@cygnus.com>
* class.c (modify_vtable_entries): Never reset the DECL_CONTEXT
of a fndecl, as we might not be from that vfield.
* decl.c (init_decl_processing): Declare __builtin_return_address
and __builtin_frame_address for C++ as well.
-Thu Mar 31 12:35:49 1994 Mike Stump (mrs@cygnus.com)
+Thu Mar 31 12:35:49 1994 Mike Stump <mrs@cygnus.com>
* typeck2.c (store_init_value): Integral constant variables are
always constant, even when doing -fpic.
* decl.c (redeclaration_error_message): Pass the types to
comptypes.
-Wed Mar 30 21:29:25 1994 Mike Stump (mrs@cygnus.com)
+Wed Mar 30 21:29:25 1994 Mike Stump <mrs@cygnus.com>
Cures incorrect errors about pure virtuals in a class, when they
have been overridden in a derived class.
(pushdecl): Use DECL_FUNCTION_MEMBER_P to decide whether or not
a function is a member.
-Wed Mar 30 14:20:50 1994 Mike Stump (mrs@cygnus.com)
+Wed Mar 30 14:20:50 1994 Mike Stump <mrs@cygnus.com>
Cures calling a more base base class function, when a more derived
base class member should be called in some MI situations.
* call.c (build_method_call): Preserve const & volatile on
`this'.
-Thu Mar 24 16:21:52 1994 Mike Stump (mrs@cygnus.com)
+Thu Mar 24 16:21:52 1994 Mike Stump <mrs@cygnus.com>
* init.c (build_new, build_vec_delete): Use global new and delete
for arrays.
* init.c (build_new): Handle array typedefs properly.
-Wed Mar 23 18:23:33 1994 Mike Stump (mrs@cygnus.com)
+Wed Mar 23 18:23:33 1994 Mike Stump <mrs@cygnus.com>
30th Cygnus<->FSF merge.
-Wed Mar 23 00:46:24 1994 Mike Stump (mrs@cygnus.com)
+Wed Mar 23 00:46:24 1994 Mike Stump <mrs@cygnus.com>
* class.c (modify_vtable_entries): Avoid running off the end of the
virtuals list when processing a virtual destructor.
* typeck.c (convert_for_assignment): Don't pedwarn about
converting function pointer to void *.
-Tue Mar 22 22:23:19 1994 Mike Stump (mrs@cygnus.com)
+Tue Mar 22 22:23:19 1994 Mike Stump <mrs@cygnus.com>
Major revamp of pointer to member functions. Cures major
nonfunctionality when used in casts, and MI situations.
* typeck.c (build_ptrmemfunc): Revamp to handle casting better, also
get vtable pointer out of right subobject.
-Tue Mar 22 17:56:48 1994 Mike Stump (mrs@cygnus.com)
+Tue Mar 22 17:56:48 1994 Mike Stump <mrs@cygnus.com>
* search.c (get_binfo): Return NULL instead of aborting, when
passed a UNION_TYPE.
(finish_decl_parsing): New function to deal with parse nodes for
code like `int (*a);'. See the difference?
-Thu Mar 17 12:16:10 1994 Mike Stump (mrs@cygnus.com)
+Thu Mar 17 12:16:10 1994 Mike Stump <mrs@cygnus.com>
These changes break binary compatibility in code with classes
that use virtual bases.
* parse.y (direct_notype_declarator): Add PTYPENAME rule, remove
all of the scoped PTYPENAME rules.
-Wed Mar 16 16:39:02 1994 Mike Stump (mrs@cygnus.com)
+Wed Mar 16 16:39:02 1994 Mike Stump <mrs@cygnus.com>
* init.c (build_offset_ref): The value of A::typedef_name is
always the TYPE_DECL, and never an error.
* error.c (dump_expr): Support member functions (which show up as
OFFSET_REFs).
-Mon Mar 14 16:24:36 1994 Mike Stump (mrs@cygnus.com)
+Mon Mar 14 16:24:36 1994 Mike Stump <mrs@cygnus.com>
* init.c (build_new): Set the return type of multidimensional
news correctly.
(direct_abstract_declarator): Replace `LEFT_RIGHT type_quals' rule
with `fcast_or_absdcl type_quals' rule.
-Fri Mar 4 16:18:03 1994 Mike Stump (mrs@cygnus.com)
+Fri Mar 4 16:18:03 1994 Mike Stump <mrs@cygnus.com>
* tree.c (lvalue_p): Improve OFFSET_REF handling, so that it
matches Section 5.5.
* error.c (dump_type_prefix): Don't print basetype twice for
pmfs.
-Fri Mar 4 13:24:33 1994 Mike Stump (mrs@cygnus.com)
+Fri Mar 4 13:24:33 1994 Mike Stump <mrs@cygnus.com>
* typeck.c (convert_arguments): Handle setHandler(A::handlerFn)
so that it is like setHandler(&A::handlerFn). Cures an `invalid
a decl. Also move the IS_AGGR_TYPE check after the stripping of
REFERENCE_TYPE.
-Fri Mar 4 04:46:05 1994 Mike Stump (mrs@cygnus.com)
+Fri Mar 4 04:46:05 1994 Mike Stump <mrs@cygnus.com>
* call.c (build_method_call): Handle b->setHandler(A::handlerFn)
so that it is like b->setHandler(&A::handlerFn). Cures an `invalid
* decl.c (start_function): Fix detection of function overloading.
-Thu Feb 24 22:26:19 1994 Mike Stump (mrs@cygnus.com)
+Thu Feb 24 22:26:19 1994 Mike Stump <mrs@cygnus.com>
* lex.c (check_newline): #pragma interface can take a string
argument, just like #pragma implementation. #pragma implementation
* tree.c (lvalue_p): A COND_EXPR is an lvalue if both of the
options are.
-Mon Feb 21 19:59:40 1994 Mike Stump (mrs@cygnus.com)
+Mon Feb 21 19:59:40 1994 Mike Stump <mrs@cygnus.com>
* Makefile.in (mostlyclean): lex.c is a source file, don't
remove.
store_init_value fails, build and expand an INIT_EXPR. If
store_init_value succeeds, call expand_decl_init.
-Fri Feb 11 02:49:23 1994 Mike Stump (mrs@cygnus.com)
+Fri Feb 11 02:49:23 1994 Mike Stump <mrs@cygnus.com>
* class.c (build_vbase_path): Use complete_type_p instead of
resolves_to_fixed_type_p to determine if the virtual bases are in
their right place for the type of expr. Cures problem of thinking a
virtual base class is one place, when it is in fact someplace else.
-Fri Feb 11 00:26:46 1994 Mike Stump (mrs@cygnus.com)
+Fri Feb 11 00:26:46 1994 Mike Stump <mrs@cygnus.com>
* init.c (resolve_offset_ref): Make sure we first convert to
intermediate type, if given, when dealing with members off `this'.
Solves an incorrrect `type `foo' is not a base type for type
`multiple'' when it is infact, a base type.
-Thu Feb 10 21:49:35 1994 Mike Stump (mrs@cygnus.com)
+Thu Feb 10 21:49:35 1994 Mike Stump <mrs@cygnus.com>
* class.c (modify_other_vtable_entries): Use get_binfo, instead
of binfo_value. Solves problem with compiler giving a `base class
herarchies, when a virtual function is first defied in a virtual
base class.
-Thu Feb 10 17:19:32 1994 Mike Stump (mrs@cygnus.com)
+Thu Feb 10 17:19:32 1994 Mike Stump <mrs@cygnus.com>
* class.c (build_vbase_path): Don't complain about ambiguous
intermediate conversion when converting down to a virtual base
* decl.c (grokdeclarator): Fix detection of virtual new/delete.
-Wed Feb 9 22:02:32 1994 Mike Stump (mrs@cygnus.com)
+Wed Feb 9 22:02:32 1994 Mike Stump <mrs@cygnus.com>
* search.c (build_mi_virtuals, add_mi_virtuals,
report_ambiguous_mi_virtuals): Removed unneeded code.
* decl.c (grokdeclarator): If friendp && virtualp, friendp = 0.
-Fri Feb 4 13:02:56 1994 Mike Stump (mrs@cygnus.com)
+Fri Feb 4 13:02:56 1994 Mike Stump <mrs@cygnus.com>
* lex.c (reinit_parse_for_method, cons_up_default_function):
Don't give warn_if_unknown_interface warning when it came from a
(build_x_unary_op): Ditto.
(build_x_conditional_expr): Ditto.
-Mon Jan 31 10:00:30 1994 Mike Stump (mrs@cygnus.com)
+Mon Jan 31 10:00:30 1994 Mike Stump <mrs@cygnus.com>
* cvt.c (build_type_conversion_1): Change call to pedwarn into
warning, and conditionalize upon warn_cast_qual.
* decl.c (grokparms): Abort if we get called with something we don't
expect.
-Thu Jan 27 17:37:25 1994 Mike Stump (mrs@cygnus.com)
+Thu Jan 27 17:37:25 1994 Mike Stump <mrs@cygnus.com>
* call.c (build_overload_call_real): Change argument complain to
flags to match style of rest of code. Pass it down to
(add_friend): Never stick in ctype.
Why are the friendship functions in init.c, anyway?
-Wed Jan 26 17:50:00 1994 Mike Stump (mrs@cygnus.com)
+Wed Jan 26 17:50:00 1994 Mike Stump <mrs@cygnus.com>
* cvt.c (build_type_conversion_1): Don't conditionalize call to
pedwarn upon pedantic.
-Wed Jan 26 17:20:46 1994 Mike Stump (mrs@cygnus.com)
+Wed Jan 26 17:20:46 1994 Mike Stump <mrs@cygnus.com>
* cvt.c (convert_to_reference): Add 8.4.3 checking so that one
gets a warning if one tries to initialize a non-const & from a
* cvt.c (convert_to_reference): Use %P format for argument
numbers in warnings.
-Wed Jan 26 14:35:06 1994 Mike Stump (mrs@cygnus.com)
+Wed Jan 26 14:35:06 1994 Mike Stump <mrs@cygnus.com>
* init.c (build_delete): Follow style in call.c to construct the
virtual call to the desctructor, as that code is right. Fixes a
* typeck.c (build_modify_expr): Don't smash references if INIT_EXPR.
-Tue Jan 25 13:54:29 1994 Mike Stump (mrs@cygnus.com)
+Tue Jan 25 13:54:29 1994 Mike Stump <mrs@cygnus.com>
* init.c (build_delete): Back out Jan 17th & 18th pacthes, as
they break libg++.
* Makefile.in (TAGS): Don't try to run etags on cp-parse.y.
-Sat Jan 15 18:34:33 1994 Mike Stump (mrs@cygnus.com)
+Sat Jan 15 18:34:33 1994 Mike Stump <mrs@cygnus.com>
* Makefile.in, configure: Handle the C++ front-end in a
subdirectory.
* cp-spew.c (yylex) : generated SCOPED_NAME token.
* cp-lex.c (yyprint): handle SCOPED_NAME.
-Fri Jan 14 17:00:29 1994 Mike Stump (mrs@cygnus.com)
+Fri Jan 14 17:00:29 1994 Mike Stump <mrs@cygnus.com>
* cp-decl.c (pushdecl): Revert patch from Jan 11 19:33:03, as it is
not right.
* cp-decl2.c (grok_x_components): fix a bug that enum type does not
have type_flags.
-Thu Jan 13 11:39:34 1994 Mike Stump (mrs@cygnus.com)
+Thu Jan 13 11:39:34 1994 Mike Stump <mrs@cygnus.com>
Ensure that all vtable pointers are initialized with all the right
values.
* cp-class.c (finish_struct): When generating default op=,
set TYPE_HAS_ASSIGNMENT.
-Mon Jan 10 18:48:06 1994 Mike Stump (mrs@cygnus.com)
+Mon Jan 10 18:48:06 1994 Mike Stump <mrs@cygnus.com>
* cp-cvt.c (convert): Make {double, clashing enum} -> enum
invalid.
* invoke.texi: Added `-fhandle-signatures' in the list of
C++ language options. Added explanation for this option.
-Tue Dec 28 21:10:03 1993 Mike Stump (mrs@cygnus.com)
+Tue Dec 28 21:10:03 1993 Mike Stump <mrs@cygnus.com>
* cp-init.c (expand_vec_init): Remove comptypes test, as it is too
harsh here.
-Tue Dec 28 13:42:22 1993 Mike Stump (mrs@cygnus.com)
+Tue Dec 28 13:42:22 1993 Mike Stump <mrs@cygnus.com>
* cp-pt.c (do_pending_expansions): Decide to expand a template
member function, based upon it's class type, not the class type of
the first place it was declared.
-Tue Dec 28 05:42:31 1993 Mike Stump (mrs@cygnus.com)
+Tue Dec 28 05:42:31 1993 Mike Stump <mrs@cygnus.com>
* cp-class.c (is_normal): New routine, use to determine when the
given binfo is the normal one. (The one that should have the simple
* cp-method.c (hack_identifier): Also check for a TYPE_PTRMEMFUNC_P
to see if something is a method.
-Wed Dec 15 18:35:58 1993 Mike Stump (mrs@cygnus.com)
+Wed Dec 15 18:35:58 1993 Mike Stump <mrs@cygnus.com>
* cp-typeck.c (build_modify_expr): Avoid error messages on small
enum bit fields.
only go for setting TRIVIAL_CODE if we are dealing with types that
are compatible.
-Thu Dec 9 18:27:22 1993 Mike Stump (mrs@cygnus.com)
+Thu Dec 9 18:27:22 1993 Mike Stump <mrs@cygnus.com>
* cp-decl.c (flag_huge_objects): New flag to allow large objects.
* toplev.c (lang_options): Ditto.
NO_{DOLLAR,DOT} macro checks, so it always gets defined.
(VTABLE_NAME_P): Define for NO_DOT && NO_DOLLAR_IN_LABEL.
-Wed Dec 8 17:38:06 1993 Mike Stump (mrs@cygnus.com)
+Wed Dec 8 17:38:06 1993 Mike Stump <mrs@cygnus.com>
* cp-decl.c (finish_decl): Make sure things that can go into
"common", do go into common, if -fcommon is given.
Propagate TYPE_GETS_ASSIGN_REF. Use cant_synth_copy_ctor. Add call
to cons_up_default_function for operator=.
-Tue Nov 23 20:24:58 1993 Mike Stump (mrs@cygnus.com)
+Tue Nov 23 20:24:58 1993 Mike Stump <mrs@cygnus.com>
* cp-cvt.c (convert_force): Add code to perform casting of pointer
to member function types.
and its kin properly.
(xref_tag): Propagate TYPE_GETS_ASSIGN_REF.
-Tue Nov 23 12:26:13 1993 Mike Stump (mrs@cygnus.com)
+Tue Nov 23 12:26:13 1993 Mike Stump <mrs@cygnus.com>
* cp-method.c (build_opfncall): Don't count pointer to member
functions as aggregates here, as we don't want to look up methods in
$(srcdir)/cp/error.c $(srcdir)/cp/init.c $(srcdir)/cp/parse.y \
$(srcdir)/cp/sig.c $(srcdir)/cp/typeck2.c
-cc1plus: $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o
+cc1plus: $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o c-pragma.o
cd cp; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) ../cc1plus
\f
# Build hooks:
edsel.o except.o init.o method.o search.o tree.o xref.o
# Language-independent object files.
-OBJS = `cat ../stamp-objlist` ../c-common.o
-OBJDEPS = ../stamp-objlist ../c-common.o
+OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
+OBJDEPS = ../stamp-objlist ../c-common.o ../c-pragma.o
compiler: ../cc1plus
../cc1plus: $(P) $(CXX_OBJS) $(OBJDEPS) $(LIBDEPS)
we can manage. */
tree temp = get_temp_name (TREE_TYPE (instance), 0);
if (IS_AGGR_TYPE (TREE_TYPE (instance)))
- expand_aggr_init (temp, instance, 0);
+ expand_aggr_init (temp, instance, 0, flags);
else
{
store_init_value (temp, instance);
{
tree type = build_pointer_type
(build_type_variant (basetype, constp, volatilep));
- TREE_VALUE (parms) = convert_force (type, instance_ptr);
+ TREE_VALUE (parms) = convert_force (type, instance_ptr, 0);
}
}
TREE_TYPE (result) = value_type;
TREE_SIDE_EFFECTS (result) = 1;
- TREE_RAISES (result)
- = TYPE_RAISES_EXCEPTIONS (fntype) || (parms && TREE_RAISES (parms));
TREE_HAS_CONSTRUCTOR (result) = is_constructor;
return result;
}
&& DECL_INITIAL (decl) != BINFO_VIRTUALS (binfo))
DECL_INITIAL (decl) = build_nt (CONSTRUCTOR, NULL_TREE,
BINFO_VIRTUALS (binfo));
- finish_decl (decl, DECL_INITIAL (decl), NULL_TREE, 0);
+ finish_decl (decl, DECL_INITIAL (decl), NULL_TREE, 0, 0);
DECL_CONTEXT (decl) = context;
}
CLEAR_BINFO_NEW_VTABLE_MARKED (binfo);
DECL_INITIAL (x) = NULL;
cp_error_at ("zero width for bit-field `%D'", x);
}
- else if ((unsigned)width > TYPE_PRECISION (TREE_TYPE (x)))
+ else if (width
+ > TYPE_PRECISION (long_long_unsigned_type_node))
{
+ /* The backend will dump if you try to use something
+ too big; avoid that. */
DECL_INITIAL (x) = NULL;
- cp_error_at ("width of `%D' exceeds its type", x);
+ sorry ("bit-fields larger than %d bits",
+ TYPE_PRECISION (long_long_unsigned_type_node));
+ cp_error_at (" in declaration of `%D'", x);
+ }
+ else if (width > TYPE_PRECISION (TREE_TYPE (x))
+ && TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE)
+ {
+ cp_warning_at ("width of `%D' exceeds its type", x);
+ }
+ else if (width < TYPE_PRECISION (TREE_TYPE (x))
+ && TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE)
+ {
+ cp_warning_at ("`%D' is too small to hold all values of `%#T'",
+ x, TREE_TYPE (x));
}
}
as well as the space of member functions.
LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already
in the parameter list.
+ LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
LOOKUP_NO_CONVERSION means that user-defined conversions are not
permitted. Built-in conversions are permitted.
LOOKUP_DESTRUCTOR means explicit call to destructor. */
CONV_STATIC : Perform the explicit conversions for static_cast.
CONV_CONST : Perform the explicit conversions for const_cast.
CONV_REINTERPRET: Perform the explicit conversions for reinterpret_cast.
- CONV_PRIVATE : Perform upcasts to private bases. */
+ CONV_PRIVATE : Perform upcasts to private bases.
+ CONV_NONCONVERTING : Allow non-converting constructors to be used. */
#define CONV_IMPLICIT 1
#define CONV_STATIC 2
#define CONV_CONST 4
#define CONV_REINTERPRET 8
#define CONV_PRIVATE 16
+#define CONV_NONCONVERTING 32
#define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC)
#define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
| CONV_REINTERPRET)
extern tree convert_pointer_to_real PROTO((tree, tree));
extern tree convert_pointer_to_vbase PROTO((tree, tree));
extern tree convert PROTO((tree, tree));
-extern tree convert_force PROTO((tree, tree));
+extern tree cp_convert PROTO((tree, tree, int, int));
+extern tree convert_force PROTO((tree, tree, int));
extern tree build_type_conversion PROTO((enum tree_code, tree, tree, int));
extern int build_default_binary_type_conversion PROTO((enum tree_code, tree *, tree *));
extern int build_default_unary_type_conversion PROTO((enum tree_code, tree *));
extern int grok_ctor_properties PROTO((tree, tree));
extern tree groktypename PROTO((tree));
extern tree start_decl PROTO((tree, tree, int, tree));
-extern void finish_decl PROTO((tree, tree, tree, int));
+extern void finish_decl PROTO((tree, tree, tree, int, int));
extern void expand_static_init PROTO((tree, tree));
extern int complete_array_type PROTO((tree, tree, int));
extern tree build_ptrmemfunc_type PROTO((tree));
extern tree finish_decl_parsing PROTO((tree));
extern tree lookup_name_nonclass PROTO((tree));
extern tree check_cp_case_value PROTO((tree));
+extern tree do_using_decl PROTO((tree));
+extern tree current_namespace_id PROTO((tree));
+extern tree get_namespace_id PROTO((void));
/* in edsel.c */
extern void expand_direct_vtbls_init PROTO((tree, tree, int, int, tree));
extern void do_member_init PROTO((tree, tree, tree));
extern void expand_member_init PROTO((tree, tree, tree));
-extern void expand_aggr_init PROTO((tree, tree, int));
+extern void expand_aggr_init PROTO((tree, tree, int, int));
extern int is_aggr_typedef PROTO((tree, int));
extern tree get_aggr_from_typedef PROTO((tree, int));
extern tree get_type_value PROTO((tree));
extern tree build_static_cast PROTO((tree, tree));
extern tree build_reinterpret_cast PROTO((tree, tree));
extern tree build_const_cast PROTO((tree, tree));
-extern tree build_c_cast PROTO((tree, tree));
+extern tree build_c_cast PROTO((tree, tree, int));
extern tree build_modify_expr PROTO((tree, enum tree_code, tree));
extern int language_lvalue_valid PROTO((tree));
extern void warn_for_assignment PROTO((char *, char *, char *, tree, int, int));
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))
{
}
else
{
+ /* We should never get here for class objects, because they are
+ always in memory. */
+ my_friendly_assert (! IS_AGGR_TYPE (argtype), 362);
temp = get_temp_name (argtype, 0);
if (global_bindings_p ())
{
/* Give this new temp some rtl and initialize it. */
DECL_INITIAL (temp) = targ;
TREE_STATIC (temp) = 1;
- finish_decl (temp, targ, NULL_TREE, 0);
+ finish_decl (temp, targ, NULL_TREE, 0, LOOKUP_ONLYCONVERTING);
/* Do this after declaring it static. */
rval = build_unary_op (ADDR_EXPR, temp, 0);
TREE_TYPE (rval) = type;
initialized. It can be error_mark_node if we don't know the _DECL but
we know it's an initialization. */
-tree cp_convert PROTO((tree, tree, int, int));
-
tree
convert_to_reference (reftype, expr, convtype, flags, decl)
tree reftype, expr;
rval = build_unary_op (ADDR_EXPR, expr, 0);
if (rval != error_mark_node)
- rval = convert_force (build_pointer_type (TREE_TYPE (reftype)), rval);
+ rval = convert_force (build_pointer_type (TREE_TYPE (reftype)), rval, 0);
if (rval != error_mark_node)
rval = build1 (NOP_EXPR, reftype, rval);
}
NULL_TREE);
TREE_TYPE (result) = TREE_TYPE (fntype);
TREE_SIDE_EFFECTS (result) = 1;
- TREE_RAISES (result) = !! TYPE_RAISES_EXCEPTIONS (fntype);
return result;
}
register tree e = expr;
register enum tree_code code = TREE_CODE (type);
- if (type == TREE_TYPE (e)
- || TREE_CODE (e) == ERROR_MARK)
- return e;
- if (TREE_CODE (TREE_TYPE (e)) == ERROR_MARK)
+ if (TREE_CODE (e) == ERROR_MARK
+ || TREE_CODE (TREE_TYPE (e)) == ERROR_MARK)
return error_mark_node;
/* Trivial conversion: cv-qualifiers do not matter on rvalues. */
/* enum = enum, enum = int, enum = float are all errors. */
if (flag_int_enum_equivalence == 0
&& TREE_CODE (type) == ENUMERAL_TYPE
- && ARITHMETIC_TYPE_P (intype))
+ && ARITHMETIC_TYPE_P (intype)
+ && ! (convtype & CONV_STATIC))
{
cp_pedwarn ("conversion from `%#T' to `%#T'", intype, type);
sig_ptr = get_temp_name (type, 1);
DECL_INITIAL (sig_ptr) = constructor;
CLEAR_SIGNATURE (sig_ty);
- finish_decl (sig_ptr, constructor, 0, 0);
+ finish_decl (sig_ptr, constructor, NULL_TREE, 0, 0);
SET_SIGNATURE (sig_ty);
TREE_READONLY (sig_ptr) = 1;
build_tree_list (NULL_TREE, e),
TYPE_BINFO (type),
LOOKUP_NORMAL | LOOKUP_SPECULATIVELY
- | LOOKUP_ONLYCONVERTING
+ | (convtype&CONV_NONCONVERTING ? 0 : LOOKUP_ONLYCONVERTING)
| (conversion ? LOOKUP_NO_CONVERSION : 0));
if (ctor == error_mark_node)
are not normally allowed due to access restrictions
(such as conversion from sub-type to private super-type). */
tree
-convert_force (type, expr)
+convert_force (type, expr, convtype)
tree type;
tree expr;
+ int convtype;
{
register tree e = expr;
register enum tree_code code = TREE_CODE (type);
/* compatible pointer to member functions. */
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), e, 1);
}
- {
- int old_equiv = flag_int_enum_equivalence;
- flag_int_enum_equivalence = 1;
- e = convert (type, e);
- flag_int_enum_equivalence = old_equiv;
- }
- return e;
+
+ return cp_convert (type, e, CONV_OLD_CONVERT|convtype, 0);
}
/* Subroutine of build_type_conversion. */
if (TREE_CODE (decl) == FUNCTION_DECL
&& ! TREE_ASM_WRITTEN (decl)
&& DECL_INITIAL (decl) != NULL_TREE
- && TREE_ADDRESSABLE (decl))
+ && TREE_ADDRESSABLE (decl)
+ && decl_function_context (decl) == current_function_decl)
{
/* If this decl was copied from a file-scope decl
on account of a block-scope extern decl,
For C++, we must compare the parameter list so that `int' can match
`int&' in a parameter position, but `int&' is not confused with
`const int&'. */
-static int
+int
decls_match (newdecl, olddecl)
tree newdecl, olddecl;
{
DECL_LANGUAGE (newdecl));
}
}
-
- /* These bits are logically part of the type. */
- if (pedantic
- && (TREE_READONLY (newdecl) != TREE_READONLY (olddecl)
- || TREE_THIS_VOLATILE (newdecl) != TREE_THIS_VOLATILE (olddecl)))
- cp_error_at ("type qualifiers for `%D' conflict with previous decl",
- newdecl);
}
/* If new decl is `static' and an `extern' was seen previously,
if (! compexcepttypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl), 0))
{
- cp_error ("declaration of `%D' raises different exceptions...",
+ cp_error ("declaration of `%D' throws different exceptions...",
newdecl);
cp_error_at ("...from previous declaration here", olddecl);
}
if (DECL_ARGUMENTS (olddecl))
DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
}
+ if (DECL_LANG_SPECIFIC (olddecl))
+ DECL_MAIN_VARIANT (newdecl) = DECL_MAIN_VARIANT (olddecl);
}
if (TREE_CODE (newdecl) == TEMPLATE_DECL)
#else
/* Type are looked up using the DECL_NAME, as that is what the rest of the
compiler wants to use. */
- if (TREE_CODE (x) == TYPE_DECL)
+ if (TREE_CODE (x) == TYPE_DECL || TREE_CODE (x) == VAR_DECL)
name = DECL_NAME (x);
#endif
&& TREE_CODE (oldglobal) == FUNCTION_DECL)
{
/* We have one. Their types must agree. */
- if (! comptypes (TREE_TYPE (x), TREE_TYPE (oldglobal), 1))
+ if (duplicate_decls (x, oldglobal))
+ /* OK */;
+ else
{
cp_warning ("extern declaration of `%#D' doesn't match", x);
cp_warning_at ("global declaration `%#D'", oldglobal);
}
- else
- {
- /* Inner extern decl is inline if global one is.
- Copy enough to really inline it. */
- if (DECL_INLINE (oldglobal))
- {
- DECL_INLINE (x) = DECL_INLINE (oldglobal);
- DECL_INITIAL (x) = (current_function_decl == oldglobal
- ? NULL_TREE : DECL_INITIAL (oldglobal));
- DECL_SAVED_INSNS (x) = DECL_SAVED_INSNS (oldglobal);
- DECL_FRAME_SIZE (x) = DECL_FRAME_SIZE (oldglobal);
- DECL_ARGUMENTS (x) = DECL_ARGUMENTS (oldglobal);
- DECL_RESULT (x) = DECL_RESULT (oldglobal);
- TREE_ASM_WRITTEN (x) = TREE_ASM_WRITTEN (oldglobal);
- DECL_ABSTRACT_ORIGIN (x) = oldglobal;
- }
- /* Inner extern decl is built-in if global one is. */
- if (DECL_BUILT_IN (oldglobal))
- {
- DECL_BUILT_IN (x) = DECL_BUILT_IN (oldglobal);
- DECL_FUNCTION_CODE (x) = DECL_FUNCTION_CODE (oldglobal);
- }
- /* Keep the arg types from a file-scope fcn defn. */
- if (TYPE_ARG_TYPES (TREE_TYPE (oldglobal)) != NULL_TREE
- && DECL_INITIAL (oldglobal)
- && TYPE_ARG_TYPES (TREE_TYPE (x)) == NULL_TREE)
- TREE_TYPE (x) = TREE_TYPE (oldglobal);
- }
}
/* If we have a local external declaration,
and no file-scope declaration has yet been seen,
{
DECL_INITIAL (tmp) = init;
TREE_STATIC (tmp) = current_binding_level == global_binding_level;
- finish_decl (tmp, init, 0, 0);
+ finish_decl (tmp, init, NULL_TREE, 0, LOOKUP_ONLYCONVERTING);
}
if (TREE_STATIC (tmp))
preserve_initializer ();
return;
}
+/* Fill in DECL_INITIAL with some magical value to prevent expand_decl from
+ mucking with forces it does not comprehend (i.e. initialization with a
+ constructor). If we are at global scope and won't go into COMMON, fill
+ it in with a dummy CONSTRUCTOR to force the variable into .data;
+ otherwise we can use error_mark_node. */
+
+static void
+obscure_complex_init (decl)
+ tree decl;
+{
+ if (current_binding_level == global_binding_level
+ && ! DECL_COMMON (decl))
+ DECL_INITIAL (decl) = build (CONSTRUCTOR, TREE_TYPE (decl), NULL_TREE,
+ NULL_TREE);
+ else
+ DECL_INITIAL (decl) = error_mark_node;
+}
+
/* Finish processing of a declaration;
install its line number and initial value.
If the length of an array type is not known before,
INIT0 holds the value of an initializer that should be allowed to escape
the normal rules.
+ FLAGS is LOOKUP_ONLYCONVERTING is the = init syntax was used, else 0
+ if the (init) syntax was used.
+
For functions that take default parameters, DECL points to its
"maximal" instantiation. `finish_decl' must then also declared its
subsequently lower and lower forms of instantiation, checking for
ambiguity as it goes. This can be sped up later. */
void
-finish_decl (decl, init, asmspec_tree, need_pop)
+finish_decl (decl, init, asmspec_tree, need_pop, flags)
tree decl, init;
tree asmspec_tree;
int need_pop;
+ int flags;
{
register tree type;
tree cleanup = NULL_TREE, ttype;
if (asmspec)
{
/* This must override the asm specifier which was placed
- by grokclassfn. Lay this out fresh.
-
- @@ Should emit an error if this redefines an asm-specified
- @@ name, or if we have already used the function's name. */
+ by grokclassfn. Lay this out fresh. */
DECL_RTL (TREE_TYPE (decl)) = NULL_RTX;
DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
make_decl_rtl (decl, asmspec, 0);
/* We must hide the initializer so that expand_decl
won't try to do something it does not understand. */
- if (current_binding_level == global_binding_level)
- {
- tree value;
- if (DECL_COMMON (decl))
- /* Should this be a NULL_TREE? */
- value = error_mark_node;
- else
- value = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
- DECL_INITIAL (decl) = value;
- }
- else
- DECL_INITIAL (decl) = error_mark_node;
+ obscure_complex_init (decl);
}
else
{
/* Don't let anyone try to initialize this variable
until we are ready to do so. */
if (init)
- {
- tree value;
- if (DECL_COMMON (decl))
- value = error_mark_node;
- else
- value = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
- DECL_INITIAL (decl) = value;
- }
+ obscure_complex_init (decl);
}
}
else if (DECL_EXTERNAL (decl))
&& (TYPE_READONLY (type) || TREE_READONLY (decl)))
cp_error ("uninitialized const `%D'", decl);
- /* Initialize variables in need of static initialization with
- an empty CONSTRUCTOR to keep assemble_variable from putting them in
- the wrong program space. */
- if (flag_pic == 0
- && TREE_STATIC (decl)
- && TREE_PUBLIC (decl)
- && ! DECL_EXTERNAL (decl)
- && TREE_CODE (decl) == VAR_DECL
- && TYPE_NEEDS_CONSTRUCTING (type)
- && (DECL_INITIAL (decl) == NULL_TREE
- || DECL_INITIAL (decl) == error_mark_node)
- && ! DECL_COMMON (decl))
- DECL_INITIAL (decl) = build (CONSTRUCTOR, type, NULL_TREE,
- NULL_TREE);
+ if (TYPE_SIZE (type) != NULL_TREE
+ && TYPE_NEEDS_CONSTRUCTING (type))
+ obscure_complex_init (decl);
}
else if (TREE_CODE (decl) == VAR_DECL
&& TREE_CODE (type) != REFERENCE_TYPE
{
emit_line_note (DECL_SOURCE_FILE (decl),
DECL_SOURCE_LINE (decl));
- expand_aggr_init (decl, init, 0);
+ expand_aggr_init (decl, init, 0, flags);
}
/* Set this to 0 so we can tell whether an aggregate which
expand_assignment (temp, integer_one_node, 0, 0);
if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)))
{
- expand_aggr_init (decl, init, 0);
+ expand_aggr_init (decl, init, 0, 0);
do_pending_stack_adjust ();
}
else
if (friendp)
cp_error_at ("invalid friend declaration", object);
if (raises)
- cp_error_at ("invalid raises declaration", object);
+ cp_error_at ("invalid exception specifications", object);
}
/* CTYPE is class type, or null if non-class.
else
decl = build_decl (VAR_DECL, declarator, type);
+ DECL_ASSEMBLER_NAME (decl) = current_namespace_id (DECL_ASSEMBLER_NAME (decl));
+
if (RIDBIT_SETP (RID_EXTERN, specbits))
{
DECL_THIS_EXTERN (decl) = 1;
init = TREE_OPERAND (decl, 1);
decl = start_decl (declarator, declspecs, 1, NULL_TREE);
- finish_decl (decl, init, NULL_TREE, 1);
+ finish_decl (decl, init, NULL_TREE, 1, 0);
return 0;
}
innermost_code = TREE_CODE (decl);
return NULL_TREE;
if (ctype == NULL_TREE && DECL_LANGUAGE (decl) != lang_c)
- DECL_ASSEMBLER_NAME (decl) = declarator;
+ DECL_ASSEMBLER_NAME (decl) = current_namespace_id (declarator);
if (staticp == 1)
{
int highprec = min_precision (maxnode, unsignedp);
int precision = MAX (lowprec, highprec);
- if (! flag_short_enums && precision < TYPE_PRECISION (integer_type_node))
- precision = TYPE_PRECISION (integer_type_node);
-
+ TYPE_SIZE (enumtype) = NULL_TREE;
- /*
- * The following code is unnecessary since the function
- * type_promotes_to deals correctly with promotion of enums of
- * underlying unsigned types to signed integer types.
- * Moreover, it causes an enum bitfield to require one more bit of
- * storage than defined by the ANSI/ISO C++ resolution section r.7.2
- * which defines the range of an enum.
- */
-#if 0
- /* Unlike the C frontend, we prefer signed types. */
- if (unsignedp && int_fits_type_p (maxnode, type_for_size (precision, 0)))
- unsignedp = 0;
-#endif
+ /* Lay out the type as though it were an integer. */
+ if (! flag_short_enums && precision < TYPE_PRECISION (integer_type_node))
+ {
+ TYPE_MIN_VALUE (enumtype) = minnode;
+ TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node);
+ layout_type (enumtype);
+ }
TYPE_PRECISION (enumtype) = precision;
- TYPE_SIZE (enumtype) = NULL_TREE;
if (unsignedp)
fixup_unsigned_type (enumtype);
else
/* Let `finish_decl' know that this initializer is ok. */
DECL_INITIAL (decl) = init;
pushdecl (decl);
- finish_decl (decl, init, 0, 0);
+ finish_decl (decl, init, NULL_TREE, 0, LOOKUP_ONLYCONVERTING);
}
}
grok_op_properties (fndecl, DECL_VIRTUAL_P (fndecl), 0);
}
- finish_decl (fndecl, NULL_TREE, NULL_TREE, 0);
+ finish_decl (fndecl, NULL_TREE, NULL_TREE, 0, 0);
/* Make a place for the parms */
pushlevel (0);
{
if (DECL_ASSEMBLER_NAME (function) == DECL_ASSEMBLER_NAME (fndecl))
return;
+ /* We have to do more extensive argument checking here, as
+ the name may have been changed by asm("new_name"). */
+ if (decls_match (function, fndecl))
+ return;
fndecl = DECL_CHAIN (fndecl);
}
break; /* loser */
{
register tree value;
char *asmspec = 0;
+ int flags = LOOKUP_ONLYCONVERTING;
/* Convert () initializers to = initializers. */
if (init == NULL_TREE && declarator != NULL_TREE
{
init = TREE_OPERAND (declarator, 1);
declarator = TREE_OPERAND (declarator, 0);
+ flags = 0;
}
if (init
DECL_INITIAL (value) = init;
DECL_IN_AGGR_P (value) = 1;
- finish_decl (value, init, asmspec_tree, 1);
+ finish_decl (value, init, asmspec_tree, 1, flags);
pushdecl_class_level (value);
return value;
}
if (TREE_CODE (value) == FIELD_DECL)
{
if (asmspec)
- DECL_ASSEMBLER_NAME (value) = get_identifier (asmspec);
+ {
+ /* This must override the asm specifier which was placed
+ by grokclassfn. Lay this out fresh. */
+ DECL_RTL (value) = NULL_RTX;
+ DECL_ASSEMBLER_NAME (value) = get_identifier (asmspec);
+ }
if (DECL_INITIAL (value) == error_mark_node)
init = error_mark_node;
- finish_decl (value, init, asmspec_tree, 1);
+ finish_decl (value, init, asmspec_tree, 1, flags);
DECL_INITIAL (value) = init;
DECL_IN_AGGR_P (value) = 1;
return value;
/* When does this happen? */
my_friendly_assert (init == NULL_TREE, 193);
}
- finish_decl (value, init, asmspec_tree, 1);
+ if (asmspec)
+ {
+ /* This must override the asm specifier which was placed
+ by grokclassfn. Lay this out fresh. */
+ DECL_RTL (value) = NULL_RTX;
+ DECL_ASSEMBLER_NAME (value) = get_identifier (asmspec);
+ }
+ finish_decl (value, init, asmspec_tree, 1, flags);
/* Pass friends back this way. */
if (DECL_FRIEND_P (value))
cp_error ("static member `%D' cannot be a bitfield", value);
return NULL_TREE;
}
- finish_decl (value, NULL_TREE, NULL_TREE, 0);
+ finish_decl (value, NULL_TREE, NULL_TREE, 0, 0);
if (width != error_mark_node)
{
return void_type_node;
}
- finish_decl (decl, NULL_TREE, NULL_TREE, 0);
+ finish_decl (decl, NULL_TREE, NULL_TREE, 0, 0);
/* If this declaration is common to another declaration
complain about such redundancy, and return NULL_TREE
DECL_INITIAL (current_vtable_decl) = error_mark_node;
/* Have to cast the initializer, since it may have come from a
more base class then we ascribe CURRENT_VTABLE_DECL to be. */
- finish_decl (current_vtable_decl, convert_force (TREE_TYPE (current_vtable_decl), vfield), 0, 0);
+ finish_decl (current_vtable_decl, convert_force (TREE_TYPE (current_vtable_decl), vfield, 0), NULL_TREE, 0, 0);
current_vtable_decl = build_indirect_ref (current_vtable_decl, NULL_PTR);
}
else
mark_inline_for_output (decl)
tree decl;
{
+ decl = DECL_MAIN_VARIANT (decl);
if (DECL_SAVED_INLINE (decl))
return;
+ my_friendly_assert (TREE_PERMANENT (decl), 363);
DECL_SAVED_INLINE (decl) = 1;
if (DECL_PENDING_INLINE_INFO (decl) != 0
&& ! DECL_PENDING_INLINE_INFO (decl)->deja_vu)
DECL_INITIAL (empty_table) = init;
asmspec = build_string (IDENTIFIER_LENGTH (DECL_NAME (empty_table)),
IDENTIFIER_POINTER (DECL_NAME (empty_table)));
- finish_decl (empty_table, init, asmspec, 0);
+ finish_decl (empty_table, init, asmspec, 0, 0);
}
is_empty = 1;
}
IDENTIFIER_POINTER (DECL_NAME (empty_table)));
}
- finish_decl (decl, init, asmspec, 0);
+ finish_decl (decl, init, asmspec, 0, 0);
return decl;
}
}
if (IS_AGGR_TYPE (TREE_TYPE (decl))
|| TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
- expand_aggr_init (decl, init, 0);
+ expand_aggr_init (decl, init, 0, 0);
else if (TREE_CODE (init) == TREE_VEC)
{
expand_expr (expand_vec_init (decl, TREE_VEC_ELT (init, 0),
/* a `new' expression at top level. */
expand_expr (decl, const0_rtx, VOIDmode, 0);
free_temp_slots ();
- expand_aggr_init (build_indirect_ref (decl, NULL_PTR), init, 0);
+ expand_aggr_init (build_indirect_ref (decl, NULL_PTR), init, 0, 0);
}
}
else if (decl == error_mark_node)
{
type = groktypename (TREE_VALUE (TREE_OPERAND (decl, 1)));
decl = TREE_OPERAND (decl, 0);
- expr = build_c_cast (type, expr);
+ expr = build_c_cast (type, expr, 0);
}
return expr;
return value;
}
+
+static tree current_namespace;
+
+/* Get the inner part of a namespace id. It doesn't have any prefix, nor
+ postfix. Returns 0 if in global namespace. */
+tree
+get_namespace_id ()
+{
+ tree x = current_namespace;
+ if (x)
+ x = TREE_PURPOSE (x);
+ return x;
+}
+
+/* Build up a DECL_ASSEMBLER_NAME for NAME in the current namespace. */
+tree
+current_namespace_id (name)
+ tree name;
+{
+ tree old_id = get_namespace_id ();
+ char *buf;
+
+ /* Global names retain old encoding. */
+ if (! old_id)
+ return name;
+
+ buf = (char *) alloca (8 + IDENTIFIER_LENGTH (old_id)
+ + IDENTIFIER_LENGTH (name));
+ sprintf (buf, "__ns_%s_%s", IDENTIFIER_POINTER (old_id),
+ IDENTIFIER_POINTER (name));
+ return get_identifier (buf);
+}
+
+/* Push into the scopre of the NAME namespace. */
+void
+push_namespace (name)
+ tree name;
+{
+ tree old_id = get_namespace_id ();
+ char *buf;
+
+ current_namespace = tree_cons (NULL_TREE, name, current_namespace);
+ buf = (char *) alloca (4 + (old_id ? IDENTIFIER_LENGTH (old_id) : 0)
+ + IDENTIFIER_LENGTH (name));
+ sprintf (buf, "%s%s", old_id ? IDENTIFIER_POINTER (old_id) : "",
+ IDENTIFIER_POINTER (name));
+ TREE_PURPOSE (current_namespace) = get_identifier (buf);
+}
+
+/* Pop from the scope of the current namespace. */
+void
+pop_namespace ()
+{
+ current_namespace = TREE_CHAIN (current_namespace);
+}
+
+void
+do_namespace_alias (alias, namespace)
+ tree alias, namespace;
+{
+}
+
+tree
+do_using_decl (decl)
+ tree decl;
+{
+ return error_mark_node;
+}
+
+void
+do_using_directive (namespace)
+ tree namespace;
+{
+}
}
else
{
- sorry ("operand of SAVE_EXPR not understood");
- goto error;
+ dump_expr (TREE_OPERAND (t, 0), 0);
}
break;
#define TRY_NEW_EH
#endif
#endif
-#if defined(__i386) || defined(__rs6000) || defined(__hppa)
+#if defined(__i386) || defined(__rs6000) || defined(__hppa) || defined(__mc68000) || defined (__mips)
#define TRY_NEW_EH
#endif
#endif
saved_throw_type = gen_rtx (REG, Pmode, 6);
saved_throw_value = gen_rtx (REG, Pmode, 7);
#endif
+#ifdef __mc68000
+ saved_pc = gen_rtx (REG, Pmode, 10);
+ saved_throw_type = gen_rtx (REG, Pmode, 11);
+ saved_throw_value = gen_rtx (REG, Pmode, 12);
+#endif
+#ifdef __mips
+ saved_pc = gen_rtx (REG, Pmode, 16);
+ saved_throw_type = gen_rtx (REG, Pmode, 17);
+ saved_throw_value = gen_rtx (REG, Pmode, 18);
+#endif
new_eh_queue (&ehqueue);
new_eh_queue (&eh_table_output_queue);
new_eh_stack (&ehstack);
if (! doing_eh (1))
return;
+ /* Code to throw out to outer context, if we fall off end of catch
+ handlers. */
+ emit_move_insn (saved_pc, gen_rtx (LABEL_REF,
+ Pmode,
+ top_label_entry (&caught_return_label_stack)));
+ emit_jump (throw_label);
+
/* Find the start of the catch block. */
last = pop_last_insn ();
catchstart = NEXT_INSN (last);
/* if it returned FALSE, jump over the catch block, else fall into it */
emit_jump_insn (gen_bne (false_label_rtx));
- finish_decl (decl, init, NULL_TREE, 0);
+ finish_decl (decl, init, NULL_TREE, 0, LOOKUP_ONLYCONVERTING);
}
else
{
/* label we jump to if we caught the exception */
emit_jump (top_label_entry (&caught_return_label_stack));
- /* Code to throw out to outer context, if we get an throw from within
+ /* Code to throw out to outer context, if we get a throw from within
our catch handler. */
/* These are saved for the exception table. */
push_rtl_perm ();
easy_expand_asm ("restore");
emit_barrier ();
#endif
-#if defined(__i386) || defined(__rs6000) || defined(__hppa)
+#if defined(__i386) || defined(__rs6000) || defined(__hppa) || defined(__mc68000) || defined (__mips)
extern FILE *asm_out_file;
tree fcall;
tree params;
emit_move_insn (saved_throw_type, throw_type_rtx);
exp = convert_to_reference (build_reference_type (build_type_variant (TREE_TYPE (exp), 1, 0)), exp, CONV_STATIC, LOOKUP_COMPLAIN, error_mark_node);
+
+ /* Make a copy of the thrown object. WP 15.1.5 */
+ exp = build_new (NULL_TREE, TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (exp))), exp, 0);
+
if (exp == error_mark_node)
error (" in thrown expression");
- throw_value_rtx = expand_expr (build_unary_op (ADDR_EXPR, exp, 0), NULL_RTX, VOIDmode, 0);
+ throw_value_rtx = expand_expr (exp, NULL_RTX, VOIDmode, 0);
emit_move_insn (saved_throw_value, throw_value_rtx);
}
}
TREE_ADDRESSABLE (init) = 1;
flag_access_control = 0;
- expand_aggr_init (slot, init, 0);
+ expand_aggr_init (slot, init, 0, LOOKUP_ONLYCONVERTING);
flag_access_control = old_ac;
if (TYPE_NEEDS_DESTRUCTOR (type))
init = build (RTL_EXPR, return_type, 0, call_target);
/* We got back a reference to the type we want. Now initialize
target with that. */
- expand_aggr_init (slot, init, 0);
+ expand_aggr_init (slot, init, 0, LOOKUP_ONLYCONVERTING);
}
if (DECL_RTL (slot) != target)
the exception object, and nothing can overwrite it, once we start
throwing. The only bad part, is that the stack remains large.
-Flaws in g++'s exception handling. The stack pointer is restored from
-stack, we want to match rs6000, and propagate the stack pointer from
-time of throw, down, to the catch place.
-
-Only exact type matching of throw types works (references work also),
-catch variables cannot be used. Only works on a Sun sparc running SunOS
-4.1.x. Unwinding to outer catch clauses works. All temps and local
-variables are cleaned up in all unwinded scopes. Completed parts of
-partially constructed objects are not cleaned up. Don't expect
-exception handling to work right if you optimize, in fact the compiler
-will probably core dump. If two EH regions are the exact same size, the
-backend cannot tell which one is first. It punts by picking the last
-one, if they tie. This is usually right. We really should stick in a
-nop, if they are the same size.
-
-If we fall off the end of a series of catch blocks, we return to the
-flow of control in a normal fasion. But this is wrong, we should
-rethrow.
+The below points out some flaws in g++'s exception handling, as it now
+stands.
+
+Only exact type matching or reference matching of throw types works.
+Only works on a SPARC machines (like Suns), and i386 machines. Partial
+support is also in for rs6000, hppa, m68k and mips machines, but a stack
+unwinder called __unwind_function has to be written, and added to
+libgcc2 for them. All completely constructed temps and local variables
+are cleaned up in all unwinded scopes. Completed parts of partially
+constructed objects are not cleaned up. Don't expect exception handling
+to work right if you optimize, in fact the compiler will probably core
+dump. If two EH regions are the exact same size, the backend cannot
+tell which one is first. It punts by picking the last one, if they tie.
+This is usually right. We really should stick in a nop, if they are the
+same size.
When we invoke the copy constructor for an exception object because it
is passed by value, and if we take a hit (exception) inside the copy
handlers, if any. If this is the wrong way to do it, we will need to
protect the rest of the handler in some fashion. Maybe just changing
the handler's handler to protect the whole series of handlers is the
-right way to go.
-
-The EH object is copied like it should be, if it is passed by value,
-otherwise we get a reference directly to it.
-
-EH objects make it through unwinding, but are subject to being
-overwritten as they are still past the top of stack. Don't throw
-automatic objects if this is a problem.
-
-Exceptions in catch handlers now go to outer block.
+right way to go. This part is wrong. We should call terminate if an
+exception is thrown while doing things like trying to copy the exception
+object.
+
+Exception specifications are handled syntax wise, but not semantic wise.
+build_exception_variant should sort the incoming list, so that is
+implements set compares, not exact list equality. Type smashing should
+smash exception specifications using set union.
+
+Thrown objects are allocated on the heap, in the usual way, but they are
+never deleted. They should be deleted by the catch clauses.
+
+In stmt.c, expand_end_bindings attempts to eliminate the generation of
+destructors for a binding contour if the code would be unreachable (last
+insn == BARRIER). In this case, interim_eh_hook is never called for the
+end of the lifetimes of auto variables, so the compiler generates
+invalid assembler (the end label for the scope is never declared, and
+destructor code isn't generated on the exception path).
@node Free Store, Concept Index, Exception Handling, Top
@section Free Store
array_type_nelts (type), TREE_VALUE (init), 1);
}
else
- expand_aggr_init (decl, init, 0);
+ expand_aggr_init (decl, init, 0, 0);
}
else
{
return;
/* Have to convert VTBL since array sizes may be different. */
- vtbl = convert_force (TREE_TYPE (vtbl_ptr), vtbl);
+ vtbl = convert_force (TREE_TYPE (vtbl_ptr), vtbl, 0);
expand_expr_stmt (build_modify_expr (vtbl_ptr, NOP_EXPR, vtbl));
}
else if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (field)))
{
parm = build_component_ref (exp, name, 0, 0);
- expand_aggr_init (parm, NULL_TREE, 0);
+ expand_aggr_init (parm, NULL_TREE, 0, 0);
rval = error_mark_node;
}
INIT comes in two flavors: it is either a value which
is to be stored in EXP, or it is a parameter list
to go to a constructor, which will operate on EXP.
+ If FLAGS is LOOKUP_ONLYCONVERTING then it is the = init form of
+ the initializer, if FLAGS is 0, then it is the (init) form.
If `init' is a CONSTRUCTOR, then we emit a warning message,
explaining that such initializations are illegal.
*/
void
-expand_aggr_init (exp, init, alias_this)
+expand_aggr_init (exp, init, alias_this, flags)
tree exp, init;
int alias_this;
+ int flags;
{
tree type = TREE_TYPE (exp);
int was_const = TREE_READONLY (exp);
init = CONSTRUCTOR_ELTS (init);
#endif
expand_aggr_init_1 (TYPE_BINFO (type), exp, exp,
- init, alias_this, LOOKUP_NORMAL);
+ init, alias_this, LOOKUP_NORMAL|flags);
TREE_READONLY (exp) = was_const;
}
init = build (CALL_EXPR, init_type,
TREE_OPERAND (init, 0), TREE_OPERAND (init, 1), 0);
TREE_SIDE_EFFECTS (init) = 1;
-#if 0
- TREE_RAISES (init) = ??
-#endif
if (init_list)
TREE_VALUE (init_list) = init;
}
init = build (CALL_EXPR, build_pointer_type (TREE_TYPE (init)),
TREE_OPERAND (init, 0), TREE_OPERAND (init, 1), 0);
TREE_SIDE_EFFECTS (init) = 1;
-#if 0
- TREE_RAISES (init) = ??
-#endif
TREE_VALUE (TREE_OPERAND (init, 1))
= convert_pointer_to (TREE_TYPE (TREE_TYPE (TREE_VALUE (tmp))), arg);
tree subexp = build_indirect_ref (convert_pointer_to (TREE_VALUE (init_list), addr), NULL_PTR);
tree member_base = build (COMPONENT_REF, TREE_TYPE (member), subexp, member);
if (IS_AGGR_TYPE (TREE_TYPE (member)))
- expand_aggr_init (member_base, DECL_INITIAL (member), 0);
+ expand_aggr_init (member_base, DECL_INITIAL (member), 0, 0);
else if (TREE_CODE (TREE_TYPE (member)) == ARRAY_TYPE
&& TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (member)))
{
{
tree newtype = build_type_variant (type, TYPE_READONLY (oldtype),
TYPE_VOLATILE (oldtype));
- decl = convert_force (build_pointer_type (newtype), olddecl);
+ decl = convert_force (build_pointer_type (newtype), olddecl, 0);
}
else
decl = olddecl;
/* New 2.0 interpretation: `new int (10)' means
allocate an int, and initialize it with 10. */
- init = build_c_cast (type, init);
+ init = build_c_cast (type, init, 1);
rval = build (COMPOUND_EXPR, TREE_TYPE (rval),
build_modify_expr (build_indirect_ref (rval, NULL_PTR),
NOP_EXPR, init),
build_binary_op (MINUS_EXPR, nelts, integer_one_node, 1),
init, 0);
else
- expand_aggr_init (build_indirect_ref (rval, NULL_PTR), init, 0);
+ expand_aggr_init (build_indirect_ref (rval, NULL_PTR), init, 0, 0);
do_pending_stack_adjust ();
if (rval && TREE_TYPE (rval) != build_pointer_type (type))
{
/* The type of new int [3][3] is not int *, but int [3] * */
- rval = build_c_cast (build_pointer_type (type), rval);
+ rval = build_c_cast (build_pointer_type (type), rval, 0);
}
if (pending_sizes)
while (elts)
{
host_i -= 1;
- expand_aggr_init (baseref, TREE_VALUE (elts), 0);
+ expand_aggr_init (baseref, TREE_VALUE (elts), 0, 0);
expand_assignment (base, baseinc, 0, 0);
elts = TREE_CHAIN (elts);
if (from_array == 2)
expand_expr_stmt (build_modify_expr (to, NOP_EXPR, from));
else if (TYPE_NEEDS_CONSTRUCTING (type))
- expand_aggr_init (to, from, 0);
+ expand_aggr_init (to, from, 0, 0);
else if (from)
expand_assignment (to, from, 0, 0);
else
array_type_nelts (type), 0, 0);
}
else
- expand_aggr_init (build1 (INDIRECT_REF, type, base), init, 0);
+ expand_aggr_init (build1 (INDIRECT_REF, type, base), init, 0, 0);
expand_assignment (base,
build (PLUS_EXPR, TYPE_POINTER_TO (type), base, size),
addr = save_expr (addr);
/* throw away const and volatile on target type of addr */
- addr = convert_force (build_pointer_type (type), addr);
+ addr = convert_force (build_pointer_type (type), addr, 0);
ref = build_indirect_ref (addr, NULL_PTR);
ptr = 1;
}
if (TREE_CONSTANT (addr))
addr = convert_pointer_to (type, addr);
else
- addr = convert_force (build_pointer_type (type), addr);
+ addr = convert_force (build_pointer_type (type), addr, 0);
if (TREE_CODE (addr) == NOP_EXPR
&& TREE_OPERAND (addr, 0) == current_class_decl)
while (vbases)
{
tree this_addr = convert_force (TYPE_POINTER_TO (BINFO_TYPE (vbases)),
- addr);
+ addr, 0);
result = tree_cons (NULL_TREE,
build_delete (TREE_TYPE (this_addr), this_addr,
integer_zero_node,
TREE_INT_CST_HIGH (fileinfo) = interface_unknown;
}
}
+#ifdef HANDLE_SYSV_PRAGMA
+ else
+ return handle_sysv_pragma (finput, c);
+#else
+#ifdef HANDLE_PRAGMA
+ else
+ HANDLE_PRAGMA (finput);
+#endif
+#endif
}
goto skipline;
}
error (buf, token_buffer);
}
+\f
+#ifdef HANDLE_SYSV_PRAGMA
+
+/* Handle a #pragma directive. INPUT is the current input stream,
+ and C is a character to reread. Processes the entire input line
+ and returns a character for the caller to reread: either \n or EOF. */
+
+/* This function has to be in this file, in order to get at
+ the token types. */
+
+int
+handle_sysv_pragma (input, c)
+ FILE *input;
+ int c;
+{
+ for (;;)
+ {
+ while (c == ' ' || c == '\t')
+ c = getc (input);
+ if (c == '\n' || c == EOF)
+ {
+ handle_pragma_token (0, 0);
+ return c;
+ }
+ ungetc (c, input);
+ switch (yylex ())
+ {
+ case IDENTIFIER:
+ case TYPENAME:
+ case STRING:
+ case CONSTANT:
+ handle_pragma_token (token_buffer, yylval.ttype);
+ break;
+ default:
+ handle_pragma_token (token_buffer, 0);
+ }
+ if (nextchar >= 0)
+ c = nextchar, nextchar = -1;
+ else
+ c = getc (input);
+ }
+}
+#endif /* HANDLE_SYSV_PRAGMA */
%nonassoc IF
%nonassoc ELSE
-%left IDENTIFIER TYPENAME PTYPENAME SCSPEC TYPESPEC TYPE_QUAL ENUM AGGR ELLIPSIS TYPEOF SIGOF OPERATOR
+%left IDENTIFIER TYPENAME PTYPENAME SCSPEC TYPESPEC TYPE_QUAL ENUM AGGR ELLIPSIS TYPEOF SIGOF OPERATOR NSNAME
%left '{' ',' ';'
%nonassoc THROW
+%right <code> ':'
%right <code> ASSIGN '='
-%right <code> '?' ':'
+%right <code> '?'
%left <code> OROR
%left <code> ANDAND
%left <code> '|'
%type <ttype> fcast_or_absdcl regcast_or_absdcl sub_cast_expr
%type <ttype> expr_or_declarator complex_notype_declarator
%type <ttype> notype_unqualified_id unqualified_id qualified_id
-%type <ttype> overqualified_id notype_qualified_id
+%type <ttype> overqualified_id notype_qualified_id any_id
%type <ttype> complex_direct_notype_declarator functional_cast
%type <ttype> named_parm complex_parmlist typed_declspecs1 parms_comma
%type <ttype> complex_type_name nested_name_specifier_1
%type <itype> nomods_initdecls nomods_initdcl0
%type <ttype> new_initializer new_placement specialization type_specifier_seq
+%type <ttype> using_decl
/* in order to recognize aggr tags as defining and thus shadowing. */
%token TYPENAME_DEFN IDENTIFIER_DEFN PTYPENAME_DEFN
%type <ttype> named_class_head_sans_basetype_defn
%type <ttype> identifier_defn IDENTIFIER_DEFN TYPENAME_DEFN PTYPENAME_DEFN
+%token NSNAME
+%type <ttype> NSNAME
+
%type <strtype> .pushlevel
/* spew.c depends on this being the last token. Define
{ $<ttype>$ = NULL_TREE; }
;
+extdefs_opt:
+ extdefs
+ | /* empty */
+ ;
+
.hush_warning:
{ have_extern_spec = 1;
used_extern_spec = 0;
| asm_keyword '(' string ')' ';'
{ if (TREE_CHAIN ($3)) $3 = combine_strings ($3);
assemble_asm ($3); }
- | extern_lang_string '{' extdefs '}'
- { pop_lang_context (); }
- | extern_lang_string '{' '}'
+ | extern_lang_string '{' extdefs_opt '}'
{ pop_lang_context (); }
| extern_lang_string .hush_warning fndef .warning_ok
{ if (pending_inlines) do_pending_inlines ();
| extern_lang_string .hush_warning datadef .warning_ok
{ if (pending_inlines) do_pending_inlines ();
pop_lang_context (); }
+ | NAMESPACE identifier '{'
+ { push_namespace ($2); }
+ extdefs_opt '}'
+ { pop_namespace (); }
+ | NAMESPACE '{'
+ { push_namespace (NULL_TREE); }
+ extdefs_opt '}'
+ { pop_namespace (); }
+ | NAMESPACE identifier '=' any_id ';'
+ { do_namespace_alias ($2, $4); }
+ | using_decl ';'
+ { }
+ | USING NAMESPACE any_id ';'
+ { do_using_directive ($3); }
+ ;
+
+using_decl:
+ USING qualified_id
+ { $$ = do_using_decl ($2); }
+ | USING global_scope qualified_id
+ { $$ = do_using_decl ($3); }
+ | USING global_scope unqualified_id
+ { $$ = do_using_decl ($3); }
+ ;
+
+any_id:
+ unqualified_id
+ | qualified_id
+ | global_scope qualified_id
+ { $$ = $2; }
+ | global_scope unqualified_id
+ { $$ = $2; }
;
extern_lang_string:
d = start_decl ($<ttype>2, /*current_declspecs*/NULL_TREE, 0,
$3);
cplus_decl_attributes (d, $5);
- finish_decl (d, NULL_TREE, $4, 0);
+ finish_decl (d, NULL_TREE, $4, 0, 0);
end_template_decl ($1, d, 0, def);
if (def)
reinit_parse_for_template ((int) $6, $1, d);
d = start_decl ($<ttype>3, current_declspecs,
0, $<ttype>4);
cplus_decl_attributes (d, $6);
- finish_decl (d, NULL_TREE, $5, 0);
+ finish_decl (d, NULL_TREE, $5, 0, 0);
end_template_decl ($1, d, 0, def);
if (def)
{
{
int def = ($4 != ';');
tree d = start_decl ($<ttype>3, $<ttype>2, 0, NULL_TREE);
- finish_decl (d, NULL_TREE, NULL_TREE, 0);
+ finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
end_template_decl ($1, d, 0, def);
if (def)
reinit_parse_for_template ((int) $4, $1, d);
| declmods notype_declarator ';'
{ tree d;
d = start_decl ($<ttype>2, $<ttype>$, 0, NULL_TREE);
- finish_decl (d, NULL_TREE, NULL_TREE, 0);
+ finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
}
| typed_declspecs initdecls ';'
{
| typed_declspecs declarator ';'
{ tree d;
d = start_decl ($<ttype>2, $<ttype>$, 0, NULL_TREE);
- finish_decl (d, NULL_TREE, NULL_TREE, 0);
+ finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
note_list_got_semicolon ($<ttype>$);
}
| declmods ';'
IDENTIFIER
| TYPENAME
| PTYPENAME
+ | NSNAME
;
notype_identifier:
IDENTIFIER
- | PTYPENAME %prec EMPTY
+ | PTYPENAME
+ | NSNAME %prec EMPTY
;
identifier_defn:
}
init
{
- finish_decl ($<ttype>7, $8, $5, 0);
+ finish_decl ($<ttype>7, $8, $5, 0, LOOKUP_ONLYCONVERTING);
resume_momentary ($<itype>6);
$$ = $<ttype>7;
if (TREE_CODE (TREE_TYPE ($$)) == ARRAY_TYPE)
{ $$ = build_m_component_ref ($$, build_x_unary_op ($2, $3)); }
| object '(' type_id ')' expr_no_commas %prec UNARY
{ tree type = groktypename ($3);
- $$ = build_m_component_ref ($$, build_c_cast (type, $5)); }
+ $$ = build_m_component_ref ($$, build_c_cast (type, $5, 0)); }
| object primary_no_id %prec UNARY
{ $$ = build_m_component_ref ($$, $2); }
*/
{ $$ = build_parse_node (BIT_NOT_EXPR, $3); }
| operator_name
| IDENTIFIER
- | PTYPENAME %prec EMPTY
+ | PTYPENAME
+ | NSNAME %prec EMPTY
;
unqualified_id:
}
#endif
else my_friendly_abort (79);
- $$ = build_c_cast (type, build_compound_expr ($3));
+ $$ = build_c_cast (type, build_compound_expr ($3), 1);
}
}
| functional_cast
{ tree d = get_decl_list ($1);
int yes = suspend_momentary ();
d = start_decl ($2, d, 0, NULL_TREE);
- finish_decl (d, NULL_TREE, NULL_TREE, 0);
+ finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
resume_momentary (yes);
if (IS_AGGR_TYPE_CODE (TREE_CODE ($1)))
note_got_semicolon ($1);
{ tree d = $1;
int yes = suspend_momentary ();
d = start_decl ($2, d, 0, NULL_TREE);
- finish_decl (d, NULL_TREE, NULL_TREE, 0);
+ finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
resume_momentary (yes);
note_list_got_semicolon ($1);
}
cplus_decl_attributes ($<ttype>$, $4); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
- { finish_decl ($<ttype>6, $7, $3, 0);
+ { finish_decl ($<ttype>6, $7, $3, 0, LOOKUP_ONLYCONVERTING);
$$ = $<itype>5; }
| declarator maybe_raises maybeasm maybe_attribute
{ tree d;
$$ = suspend_momentary ();
d = start_decl ($<ttype>1, current_declspecs, 0, $2);
cplus_decl_attributes (d, $4);
- finish_decl (d, NULL_TREE, $3, 0); }
+ finish_decl (d, NULL_TREE, $3, 0, 0); }
;
initdcl:
cplus_decl_attributes ($<ttype>$, $4); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
- { finish_decl ($<ttype>6, $7, $3, 0); }
+ { finish_decl ($<ttype>6, $7, $3, 0, LOOKUP_ONLYCONVERTING); }
| declarator maybe_raises maybeasm maybe_attribute
{ $<ttype>$ = start_decl ($<ttype>1, current_declspecs, 0, $2);
cplus_decl_attributes ($<ttype>$, $4);
- finish_decl ($<ttype>$, NULL_TREE, $3, 0); }
+ finish_decl ($<ttype>$, NULL_TREE, $3, 0, 0); }
;
notype_initdcl0:
cplus_decl_attributes ($<ttype>$, $4); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
- { finish_decl ($<ttype>6, $7, $3, 0);
+ { finish_decl ($<ttype>6, $7, $3, 0, LOOKUP_ONLYCONVERTING);
$$ = $<itype>5; }
| notype_declarator maybe_raises maybeasm maybe_attribute
{ tree d;
$$ = suspend_momentary ();
d = start_decl ($<ttype>1, current_declspecs, 0, $2);
cplus_decl_attributes (d, $4);
- finish_decl (d, NULL_TREE, $3, 0); }
+ finish_decl (d, NULL_TREE, $3, 0, 0); }
;
nomods_initdcl0:
cplus_decl_attributes ($<ttype>$, $4); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
- { finish_decl ($<ttype>6, $7, $3, 0);
+ { finish_decl ($<ttype>6, $7, $3, 0, LOOKUP_ONLYCONVERTING);
$$ = $<itype>5; }
| notype_declarator maybe_raises maybeasm maybe_attribute
{ tree d;
$$ = suspend_momentary ();
d = start_decl ($1, current_declspecs, 0, $2);
cplus_decl_attributes (d, $4);
- finish_decl (d, NULL_TREE, $3, 0); }
+ finish_decl (d, NULL_TREE, $3, 0, 0); }
;
/* the * rules are dummies to accept the Apollo extended syntax
empty_parms (), $3);
$$ = grokfield ($$, TREE_CHAIN ($1), NULL_TREE, NULL_TREE,
NULL_TREE); }
+ | using_decl
;
/* The case of exactly one component is handled directly by component_decl. */
nested_name_specifier_1:
TYPENAME SCOPE
{ got_scope = TREE_TYPE ($$); }
+ | NSNAME SCOPE
+ { got_scope = TREE_TYPE ($$); }
| template_type SCOPE
{ got_scope = TREE_TYPE ($$); }
/* These break 'const i;'
bad_parm:
/* empty */ %prec EMPTY
{
- warning ("type specifier omitted for parameter");
- $$ = build_tree_list (TREE_PURPOSE (TREE_VALUE ($<ttype>-1)), NULL_TREE);
+ error ("type specifier omitted for parameter");
+ $$ = build_tree_list (integer_type_node, NULL_TREE);
}
| notype_declarator
{
- warning ("type specifier omitted for parameter");
- $$ = build_tree_list (TREE_PURPOSE (TREE_VALUE ($<ttype>-1)), $$);
+ error ("type specifier omitted for parameter");
+ $$ = build_tree_list (integer_type_node, $$);
}
;
{ $$ = NULL_TREE; }
| THROW '(' ansi_raise_identifiers ')' %prec EMPTY
{ $$ = $3; }
+ | THROW LEFT_RIGHT %prec EMPTY
+ { $$ = build_decl_list (NULL_TREE, NULL_TREE); }
;
ansi_raise_identifier:
type_id
- { $$ = build_decl_list (NULL_TREE, $$); }
+ { $$ = build_decl_list (NULL_TREE, groktypename($$)); }
;
ansi_raise_identifiers:
else if (! flag_implicit_templates)
DECIDE (0);
- /* OK, it was an implicit instantiation. */
- TREE_PUBLIC (t) = 0;
+ if (i->interface == 1)
+ /* OK, it was an implicit instantiation. */
+ TREE_PUBLIC (t) = 0;
/* If it's a method, let the class type decide it.
@@ What if the method template is in a separate file?
|| TYPE_VOLATILE (v) != volatilep)
continue;
- t = raises;
- t2 = TYPE_RAISES_EXCEPTIONS (v);
- while (t && t2)
- {
- if (TREE_TYPE (t) == TREE_TYPE (t2))
- {
- t = TREE_CHAIN (t);
- t2 = TREE_CHAIN (t2);
- }
- else break;
- }
- if (t || t2)
- continue;
- /* List of exceptions raised matches previously found list.
+ /* @@ This should do set equality, not exact match. */
+ if (simple_cst_list_equal (TYPE_RAISES_EXCEPTIONS (v), raises))
+ /* List of exceptions raised matches previously found list.
- @@ Nice to free up storage used in consing up the
- @@ list of exceptions raised. */
- return v;
+ @@ Nice to free up storage used in consing up the
+ @@ list of exceptions raised. */
+ return v;
}
/* Need to build a new variant. */
decl = convert_pointer_to (TREE_TYPE (ctypeptr), decl);
}
else
- decl = build_c_cast (ctypeptr, decl);
+ decl = build_c_cast (ctypeptr, decl, 0);
params = tree_cons (NULL_TREE, decl, params);
}
function, coerced_params, NULL_TREE);
TREE_SIDE_EFFECTS (result) = 1;
- /* Remove this sometime. */
- TREE_RAISES (result) |= !! TYPE_RAISES_EXCEPTIONS (fntype);
if (! require_complete)
return result;
if (value_type == void_type_node)
register tree typetail, valtail;
register tree result = NULL_TREE;
char *called_thing;
- int maybe_raises = 0;
int i = 0;
if (! flag_elide_constructors)
if (val == error_mark_node)
continue;
- maybe_raises |= TREE_RAISES (val);
-
if (type != 0)
{
/* Formal parm type is specified by a function prototype. */
parmval = default_conversion (parmval);
#endif
}
- maybe_raises |= TREE_RAISES (parmval);
if (flag_gc
&& type_needs_gc_entry (TREE_TYPE (parmval))
return error_mark_list;
}
}
- if (result)
- TREE_RAISES (result) = maybe_raises;
return nreverse (result);
}
type1 = TREE_TYPE (args[0]);
type2 = TREE_TYPE (args[1]);
- if (IS_AGGR_TYPE_2 (type1, type2) && ! TYPE_PTRMEMFUNC_P (type1))
+ if (IS_AGGR_TYPE_2 (type1, type2))
{
/* Try to convert this to something reasonable. */
if (! build_default_binary_type_conversion(code, &args[0], &args[1]))
return error_mark_node;
}
- else if ((IS_AGGR_TYPE (type1) && ! TYPE_PTRMEMFUNC_P (type1))
- || (IS_AGGR_TYPE (type2) && ! TYPE_PTRMEMFUNC_P (type2)))
+ else if (IS_AGGR_TYPE (type1) || IS_AGGR_TYPE (type2))
{
int convert_index = IS_AGGR_TYPE (type2);
/* Avoid being tripped up by things like (ARG1 != 0). */
}
else
/* This conversion is harmless. */
- rval = convert_force (argtype, rval);
+ rval = convert_force (argtype, rval, 0);
if (! integer_zerop (DECL_FIELD_BITPOS (field)))
{
tree build_static_cast (type, expr)
tree type, expr;
{
- return build_c_cast (type, expr);
+ return build_c_cast (type, expr, 0);
}
tree build_reinterpret_cast (type, expr)
tree type, expr;
{
- return build_c_cast (type, expr);
+ return build_c_cast (type, expr, 0);
}
tree build_const_cast (type, expr)
tree type, expr;
{
- return build_c_cast (type, expr);
+ return build_c_cast (type, expr, 0);
}
-/* Build an expression representing a cast to type TYPE of expression EXPR. */
+/* Build an expression representing a cast to type TYPE of expression EXPR.
+
+ ALLOW_NONCONVERTING is true if we should allow non-converting constructors
+ when doing the cast. */
tree
-build_c_cast (type, expr)
+build_c_cast (type, expr, allow_nonconverting)
register tree type;
tree expr;
+ int allow_nonconverting;
{
register tree value = expr;
value = decl_constant_value (value);
ovalue = value;
- value = convert_force (type, value);
+ value = convert_force (type, value, allow_nonconverting?CONV_NONCONVERTING:0);
/* Ignore any integer overflow caused by the cast. */
if (TREE_CODE (value) == INTEGER_CST)
{
newrhs = convert_for_assignment (olhstype, newrhs, "assignment",
NULL_TREE, 0);
- newrhs = convert_force (lhstype, newrhs);
+ newrhs = convert_force (lhstype, newrhs, 0);
}
else
newrhs = convert_for_assignment (lhstype, newrhs, "assignment",
/* Handle null pointer to member function conversions. */
if (integer_zerop (pfn))
{
- pfn = build_c_cast (type, integer_zero_node);
+ pfn = build_c_cast (type, integer_zero_node, 0);
u = build_nt (CONSTRUCTOR, 0, tree_cons (pfn_identifier, pfn, NULL_TREE));
u = build_nt (CONSTRUCTOR, 0, tree_cons (NULL_TREE, integer_zero_node,
tree_cons (NULL_TREE, integer_zero_node,
}
/* Conversions involving enums. */
else if ((codel == ENUMERAL_TYPE
- && (coder == ENUMERAL_TYPE || coder == INTEGER_TYPE || coder == REAL_TYPE))
+ && (INTEGRAL_CODE_P (coder) || coder == REAL_TYPE))
|| (coder == ENUMERAL_TYPE
- && (codel == ENUMERAL_TYPE || codel == INTEGER_TYPE || codel == REAL_TYPE)))
+ && (INTEGRAL_CODE_P (codel) || codel == REAL_TYPE)))
{
- return convert (type, rhs);
+ return cp_convert (type, rhs, CONV_IMPLICIT, 0);
}
/* Conversions among pointers */
else if (codel == POINTER_TYPE
if (TREE_CODE (retval) == WITH_CLEANUP_EXPR
&& TREE_CODE (TREE_OPERAND (retval, 0)) == TARGET_EXPR)
retval = TREE_OPERAND (retval, 0);
- expand_aggr_init (result, retval, 0);
+ expand_aggr_init (result, retval, 0, LOOKUP_ONLYCONVERTING);
expand_cleanups_to (NULL_TREE);
DECL_INITIAL (result) = NULL_TREE;
retval = 0;
silly. So instead, we just do the equivalent of a call to fatal in the
same situation (call exit). */
-/* First used: 0 (reserved), Last used: 361. Free: */
+/* First used: 0 (reserved), Last used: 363. Free: */
static int abortcount = 0;
pedwarn ("initializer list being treated as compound expression");
parms = build_compound_expr (parms);
}
- return build_c_cast (type, parms);
+ return build_c_cast (type, parms, 1);
}
if (TYPE_SIZE (type) == NULL_TREE)
}
if (parms && TREE_CHAIN (parms) == NULL_TREE)
- return build_c_cast (type, parms);
+ return build_c_cast (type, parms, 1);
expr_as_ctor = build_method_call (NULL_TREE, name, parms,
NULL_TREE, LOOKUP_NORMAL);