Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
6060a796
Commit
6060a796
authored
Dec 16, 1994
by
Mike Stump
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
50th Cygnus<->FSF merge
From-SVN: r8657
parent
27efbf21
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
750 additions
and
357 deletions
+750
-357
gcc/cp/ChangeLog
+288
-69
gcc/cp/Make-lang.in
+1
-1
gcc/cp/Makefile.in
+2
-2
gcc/cp/call.c
+2
-4
gcc/cp/class.c
+19
-3
gcc/cp/cp-tree.h
+12
-5
gcc/cp/cvt.c
+19
-20
gcc/cp/decl.c
+57
-104
gcc/cp/decl2.c
+106
-12
gcc/cp/error.c
+1
-2
gcc/cp/except.c
+26
-5
gcc/cp/expr.c
+2
-2
gcc/cp/gxxint.texi
+33
-28
gcc/cp/init.c
+19
-22
gcc/cp/lex.c
+52
-0
gcc/cp/parse.y
+79
-31
gcc/cp/pt.c
+3
-2
gcc/cp/tree.c
+6
-17
gcc/cp/typeck.c
+20
-25
gcc/cp/typeck2.c
+3
-3
No files found.
gcc/cp/ChangeLog
View file @
6060a796
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.
...
...
@@ -9,6 +86,148 @@ Fri Dec 2 10:44:36 1994 Mike Stump (mrs@wombat.gnu.ai.mit.edu)
* 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
...
...
@@ -527,7 +746,7 @@ Thu Sep 29 13:08:50 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -804,7 +1023,7 @@ Wed Aug 24 11:11:50 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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>...
...
...
@@ -839,7 +1058,7 @@ Fri Aug 19 14:04:47 1994 Kung Hsu (kung@mexican.cygnus.com)
* 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.
...
...
@@ -853,7 +1072,7 @@ Wed Sep 14 10:17:27 1994 Michael I Bushnell <mib@churchy.gnu.ai.mit.edu>
* 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.
...
...
@@ -1061,7 +1280,7 @@ Fri Aug 5 14:20:16 1994 Jason Merrill (jason@deneb.cygnus.com)
(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,
...
...
@@ -1207,7 +1426,7 @@ Mon Jul 11 18:37:20 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -1263,7 +1482,7 @@ Thu Jul 7 13:39:37 1994 Jason Merrill (jason@deneb.cygnus.com)
(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.
...
...
@@ -1360,7 +1579,7 @@ Fri Jun 24 16:49:41 1994 Gerald Baumgartner (gb@cs.purdue.edu)
* 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.
...
...
@@ -1493,7 +1712,7 @@ Wed Jun 15 19:34:54 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -1576,7 +1795,7 @@ Thu Jun 9 19:04:59 1994 Jason Merrill (jason@deneb.cygnus.com)
(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
...
...
@@ -1662,7 +1881,7 @@ Wed Jun 1 18:57:35 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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
...
...
@@ -1684,7 +1903,7 @@ Wed Jun 1 11:11:15 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
* 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.
...
...
@@ -1780,7 +1999,7 @@ Fri May 27 13:57:40 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -2049,7 +2268,7 @@ Fri May 13 16:45:07 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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).
...
...
@@ -2059,7 +2278,7 @@ Fri May 13 16:16:37 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -2074,7 +2293,7 @@ Fri May 13 10:30:42 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
* 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,
...
...
@@ -2095,7 +2314,7 @@ Fri May 13 01:43:18 1994 Jason Merrill (jason@deneb.cygnus.com)
(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
...
...
@@ -2117,7 +2336,7 @@ Thu May 12 19:13:54 1994 Richard Earnshaw (rwe11@cl.cam.ac.uk)
* 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
...
...
@@ -2188,7 +2407,7 @@ Tue May 10 11:52:04 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
* 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.
...
...
@@ -2225,7 +2444,7 @@ Sun May 8 01:29:13 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -2297,7 +2516,7 @@ Fri May 6 03:53:23 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -2556,7 +2775,7 @@ Thu Apr 28 02:12:08 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -2585,7 +2804,7 @@ Wed Apr 27 18:10:12 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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
...
...
@@ -2600,7 +2819,7 @@ Wed Apr 27 15:36:49 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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,
...
...
@@ -2642,7 +2861,7 @@ Wed Apr 27 01:17:08 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -2885,7 +3104,7 @@ Wed Apr 20 16:51:06 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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
...
...
@@ -3305,7 +3524,7 @@ Thu Apr 7 17:47:53 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -3322,7 +3541,7 @@ Thu Apr 7 17:47:53 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -3403,7 +3622,7 @@ Tue Apr 5 17:48:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
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.
...
...
@@ -3468,7 +3687,7 @@ Sat Jan 23 23:23:26 1994 Stephen R. van den Berg (berg@pool.informatik.rwth-aa
* 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.
...
...
@@ -3478,7 +3697,7 @@ Sat Jan 23 23:23:26 1994 Stephen R. van den Berg (berg@pool.informatik.rwth-aa
* 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.
...
...
@@ -3514,7 +3733,7 @@ Wed Mar 30 14:10:04 1994 Jason Merrill (jason@deneb.cygnus.com)
(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.
...
...
@@ -3642,7 +3861,7 @@ Thu Mar 24 23:18:19 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -3661,11 +3880,11 @@ Wed Mar 23 17:45:37 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -3681,7 +3900,7 @@ Tue Mar 22 23:49:41 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -3702,7 +3921,7 @@ Tue Mar 22 22:23:19 1994 Mike Stump (mrs@cygnus.com)
* 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.
...
...
@@ -3839,7 +4058,7 @@ Thu Mar 17 17:30:01 1994 Jason Merrill (jason@deneb.cygnus.com)
(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.
...
...
@@ -3866,7 +4085,7 @@ Wed Mar 16 17:43:07 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -3890,7 +4109,7 @@ Tue Mar 15 15:33:31 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -3950,7 +4169,7 @@ Fri Mar 4 18:22:39 1994 Jason Merrill (jason@deneb.cygnus.com)
(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.
...
...
@@ -3960,7 +4179,7 @@ Fri Mar 4 14:01:59 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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
...
...
@@ -3990,7 +4209,7 @@ Fri Mar 4 11:15:59 1994 Jason Merrill (jason@deneb.cygnus.com)
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
...
...
@@ -4092,7 +4311,7 @@ Fri Feb 25 15:23:42 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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
...
...
@@ -4152,7 +4371,7 @@ Tue Feb 22 12:10:32 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -4313,21 +4532,21 @@ hu Jan 13 17:55:51 EST 1994 Gnanasekaran Swaminathan (gs4t@virginia.edu)
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
...
...
@@ -4335,7 +4554,7 @@ Thu Feb 10 21:49:35 1994 Mike Stump (mrs@cygnus.com)
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
...
...
@@ -4351,7 +4570,7 @@ Thu Feb 10 12:18:26 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -4535,7 +4754,7 @@ Fri Feb 4 14:21:00 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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
...
...
@@ -4689,7 +4908,7 @@ Mon Jan 31 12:07:30 1994 Jason Merrill (jason@deneb.cygnus.com)
(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.
...
...
@@ -4723,7 +4942,7 @@ Thu Jan 27 19:26:51 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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
...
...
@@ -4784,12 +5003,12 @@ Wed Jan 26 18:28:14 1994 Jason Merrill (jason@deneb.cygnus.com)
(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
...
...
@@ -4797,7 +5016,7 @@ Wed Jan 26 17:20:46 1994 Mike Stump (mrs@cygnus.com)
* 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
...
...
@@ -4814,7 +5033,7 @@ Tue Jan 25 18:39:12 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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++.
...
...
@@ -4933,7 +5152,7 @@ Mon Jan 17 13:58:18 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -4974,7 +5193,7 @@ Fri Jan 14 18:25:29 1994 Kung Hsu (kung@mexican.cygnus.com)
* 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.
...
...
@@ -4984,7 +5203,7 @@ Thu Jan 13 14:00:35 1994 Kung Hsu (kung@mexican.cygnus.com)
* 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.
...
...
@@ -5034,7 +5253,7 @@ Tue Jan 11 19:33:03 1994 Jason Merrill (jason@deneb.cygnus.com)
* 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.
...
...
@@ -5093,18 +5312,18 @@ Mon Jan 3 22:22:32 1994 Gerald Baumgartner (gb@cygnus.com)
* 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
...
...
@@ -5238,7 +5457,7 @@ Thu Dec 16 12:17:06 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
* 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.
...
...
@@ -5287,7 +5506,7 @@ Fri Dec 10 12:40:25 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
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.
...
...
@@ -5305,7 +5524,7 @@ Thu Dec 9 16:19:05 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
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.
...
...
@@ -5593,7 +5812,7 @@ Wed Nov 24 00:49:35 1993 Jason Merrill (jason@deneb.cygnus.com)
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.
...
...
@@ -5612,7 +5831,7 @@ Tue Nov 23 18:06:58 1993 Jason Merrill (jason@deneb.cygnus.com)
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
...
...
gcc/cp/Make-lang.in
View file @
6060a796
...
...
@@ -75,7 +75,7 @@ CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/decl2.c \
$(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
# Build hooks:
...
...
gcc/cp/Makefile.in
View file @
6060a796
...
...
@@ -162,8 +162,8 @@ CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
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)
...
...
gcc/cp/call.c
View file @
6060a796
...
...
@@ -1802,7 +1802,7 @@ build_method_call (instance, name, parms, basetype_path, flags)
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
);
...
...
@@ -2144,7 +2144,7 @@ build_method_call (instance, name, parms, basetype_path, flags)
{
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
);
}
}
...
...
@@ -2652,8 +2652,6 @@ build_method_call (instance, name, parms, basetype_path, flags)
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
;
}
...
...
gcc/cp/class.c
View file @
6060a796
...
...
@@ -2116,7 +2116,7 @@ finish_vtbls (binfo, do_self, t)
&&
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
);
...
...
@@ -3161,10 +3161,26 @@ finish_struct (t, list_of_fieldlists, warn_anon)
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
));
}
}
...
...
gcc/cp/cp-tree.h
View file @
6060a796
...
...
@@ -1787,6 +1787,7 @@ extern tree current_class_type; /* _TYPE: the type of the current class */
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. */
...
...
@@ -1809,13 +1810,15 @@ extern tree current_class_type; /* _TYPE: the type of the current class */
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)
...
...
@@ -1896,7 +1899,8 @@ extern tree convert_pointer_to PROTO((tree, tree));
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
*
));
...
...
@@ -1956,7 +1960,7 @@ extern void shadow_tag PROTO((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
));
...
...
@@ -2018,6 +2022,9 @@ extern tree reparse_decl_as_expr PROTO((tree, 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 */
...
...
@@ -2066,7 +2073,7 @@ extern void check_base_init PROTO((tree));
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
));
...
...
@@ -2347,7 +2354,7 @@ extern tree build_compound_expr 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
));
...
...
gcc/cp/cvt.c
View file @
6060a796
...
...
@@ -309,6 +309,10 @@ build_up_reference (type, arg, flags, checkconst)
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
))
{
...
...
@@ -552,13 +556,16 @@ build_up_reference (type, arg, flags, checkconst)
}
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
;
...
...
@@ -605,8 +612,6 @@ build_up_reference (type, arg, flags, checkconst)
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
;
...
...
@@ -703,7 +708,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
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
);
}
...
...
@@ -1061,7 +1066,6 @@ convert_to_aggr (type, expr, msgp, protect)
NULL_TREE
);
TREE_TYPE
(
result
)
=
TREE_TYPE
(
fntype
);
TREE_SIDE_EFFECTS
(
result
)
=
1
;
TREE_RAISES
(
result
)
=
!!
TYPE_RAISES_EXCEPTIONS
(
fntype
);
return
result
;
}
...
...
@@ -1184,10 +1188,8 @@ cp_convert (type, expr, convtype, flags)
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. */
...
...
@@ -1229,7 +1231,8 @@ cp_convert (type, expr, convtype, flags)
/* 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
);
...
...
@@ -1309,7 +1312,7 @@ cp_convert (type, expr, convtype, flags)
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
;
...
...
@@ -1338,7 +1341,7 @@ cp_convert (type, expr, convtype, flags)
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
)
...
...
@@ -1428,9 +1431,10 @@ convert (type, expr)
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
);
...
...
@@ -1455,13 +1459,8 @@ convert_force (type, expr)
/* 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. */
...
...
gcc/cp/decl.c
View file @
6060a796
...
...
@@ -932,7 +932,8 @@ poplevel (keep, reverse, functionbody)
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,
...
...
@@ -1933,7 +1934,7 @@ clear_anon_tags ()
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
;
{
...
...
@@ -2276,13 +2277,6 @@ duplicate_decls (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,
...
...
@@ -2391,7 +2385,7 @@ duplicate_decls (newdecl, olddecl)
if
(
!
compexcepttypes
(
TREE_TYPE
(
newdecl
),
TREE_TYPE
(
olddecl
),
0
))
{
cp_error
(
"declaration of `%D'
raise
s different exceptions..."
,
cp_error
(
"declaration of `%D'
throw
s different exceptions..."
,
newdecl
);
cp_error_at
(
"...from previous declaration here"
,
olddecl
);
}
...
...
@@ -2535,6 +2529,8 @@ duplicate_decls (newdecl, 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
)
...
...
@@ -2671,7 +2667,7 @@ pushdecl (x)
#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
...
...
@@ -2908,39 +2904,13 @@ pushdecl (x)
&&
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,
...
...
@@ -5625,7 +5595,7 @@ make_temporary_for_reference (decl, ctor_call, init, cleanupp)
{
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 ();
...
...
@@ -5740,6 +5710,24 @@ grok_reference_init (decl, type, init, cleanupp)
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,
...
...
@@ -5754,16 +5742,20 @@ grok_reference_init (decl, type, init, cleanupp)
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
;
...
...
@@ -5871,10 +5863,7 @@ finish_decl (decl, init, asmspec_tree, need_pop)
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
);
...
...
@@ -5971,18 +5960,7 @@ finish_decl (decl, init, asmspec_tree, need_pop)
/* 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
{
...
...
@@ -5993,14 +5971,7 @@ finish_decl (decl, init, asmspec_tree, need_pop)
/* 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
))
...
...
@@ -6026,20 +5997,9 @@ finish_decl (decl, init, asmspec_tree, need_pop)
&&
(
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
...
...
@@ -6396,7 +6356,7 @@ finish_decl (decl, init, asmspec_tree, need_pop)
{
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
...
...
@@ -6510,7 +6470,7 @@ expand_static_init (decl, init)
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
...
...
@@ -6639,7 +6599,7 @@ bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises)
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.
...
...
@@ -6889,6 +6849,8 @@ grokvardecl (type, declarator, specbits, initialized)
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
;
...
...
@@ -7166,7 +7128,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, raises)
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
);
...
...
@@ -9071,7 +9033,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, raises)
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
)
{
...
...
@@ -10349,26 +10311,17 @@ finish_enum (enumtype, values)
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
...
...
@@ -11110,7 +11063,7 @@ store_return_init (return_id, init)
/* 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
);
}
}
...
...
@@ -11757,7 +11710,7 @@ start_method (declspecs, declarator, raises)
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
);
...
...
gcc/cp/decl2.c
View file @
6060a796
...
...
@@ -1147,6 +1147,10 @@ check_classfn (ctype, cname, function)
{
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 */
...
...
@@ -1195,6 +1199,7 @@ grokfield (declarator, declspecs, raises, init, asmspec_tree)
{
register
tree
value
;
char
*
asmspec
=
0
;
int
flags
=
LOOKUP_ONLYCONVERTING
;
/* Convert () initializers to = initializers. */
if
(
init
==
NULL_TREE
&&
declarator
!=
NULL_TREE
...
...
@@ -1206,6 +1211,7 @@ grokfield (declarator, declspecs, raises, init, asmspec_tree)
{
init
=
TREE_OPERAND
(
declarator
,
1
);
declarator
=
TREE_OPERAND
(
declarator
,
0
);
flags
=
0
;
}
if
(
init
...
...
@@ -1353,17 +1359,22 @@ grokfield (declarator, declspecs, raises, init, asmspec_tree)
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
;
...
...
@@ -1378,7 +1389,14 @@ grokfield (declarator, declspecs, raises, init, asmspec_tree)
/* 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
))
...
...
@@ -1439,7 +1457,7 @@ grokbitfield (declarator, declspecs, width)
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
)
{
...
...
@@ -1631,7 +1649,7 @@ groktypefield (declspecs, parmlist)
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
...
...
@@ -1934,7 +1952,7 @@ setup_vtbl_ptr ()
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
...
...
@@ -1947,8 +1965,10 @@ void
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
)
...
...
@@ -2176,7 +2196,7 @@ finish_table (name, type, init, publicp)
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
;
}
...
...
@@ -2214,7 +2234,7 @@ finish_table (name, type, init, publicp)
IDENTIFIER_POINTER
(
DECL_NAME
(
empty_table
)));
}
finish_decl
(
decl
,
init
,
asmspec
,
0
);
finish_decl
(
decl
,
init
,
asmspec
,
0
,
0
);
return
decl
;
}
...
...
@@ -2782,7 +2802,7 @@ finish_file ()
}
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
),
...
...
@@ -2803,7 +2823,7 @@ finish_file ()
/* 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
)
...
...
@@ -3041,7 +3061,7 @@ reparse_absdcl_as_casts (decl, expr)
{
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
;
...
...
@@ -3166,3 +3186,77 @@ check_cp_case_value (value)
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
;
{
}
gcc/cp/error.c
View file @
6060a796
...
...
@@ -1017,8 +1017,7 @@ dump_expr (t, nop)
}
else
{
sorry
(
"operand of SAVE_EXPR not understood"
);
goto
error
;
dump_expr
(
TREE_OPERAND
(
t
,
0
),
0
);
}
break
;
...
...
gcc/cp/except.c
View file @
6060a796
...
...
@@ -43,7 +43,7 @@ tree builtin_return_address_fndecl;
#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
...
...
@@ -803,6 +803,16 @@ init_exception_processing ()
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
);
...
...
@@ -977,6 +987,13 @@ expand_end_all_catch ()
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
);
...
...
@@ -1136,7 +1153,7 @@ expand_start_catch_block (declspecs, declarator)
/* 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
{
...
...
@@ -1165,7 +1182,7 @@ void expand_end_catch_block ()
/* 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 a
n
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
();
...
...
@@ -1240,7 +1257,7 @@ do_unwind (throw_label)
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
;
...
...
@@ -1443,9 +1460,13 @@ expand_throw (exp)
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
);
}
}
...
...
gcc/cp/expr.c
View file @
6060a796
...
...
@@ -155,7 +155,7 @@ cplus_expand_expr (exp, target, tmode, modifier)
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
))
...
...
@@ -195,7 +195,7 @@ cplus_expand_expr (exp, target, tmode, modifier)
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
)
...
...
gcc/cp/gxxint.texi
View file @
6060a796
...
...
@@ -1189,24 +1189,21 @@ the object was thrown. This is so that there is always someplace for
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
...
...
@@ -1216,16 +1213,24 @@ exists, but rather to allow the frame to unwind into the next series of
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
...
...
gcc/cp/init.c
View file @
6060a796
...
...
@@ -185,7 +185,7 @@ perform_member_init (member, name, init, explicit)
array_type_nelts
(
type
),
TREE_VALUE
(
init
),
1
);
}
else
expand_aggr_init
(
decl
,
init
,
0
);
expand_aggr_init
(
decl
,
init
,
0
,
0
);
}
else
{
...
...
@@ -734,7 +734,7 @@ expand_virtual_init (binfo, decl)
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
));
}
...
...
@@ -1071,7 +1071,7 @@ expand_member_init (exp, name, init)
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
;
}
...
...
@@ -1087,6 +1087,8 @@ expand_member_init (exp, name, init)
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.
...
...
@@ -1116,9 +1118,10 @@ expand_member_init (exp, name, init)
*/
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
);
...
...
@@ -1179,7 +1182,7 @@ expand_aggr_init (exp, init, alias_this)
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
;
}
...
...
@@ -1353,9 +1356,6 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
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
;
}
...
...
@@ -1425,9 +1425,6 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
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
);
...
...
@@ -1561,7 +1558,7 @@ expand_recursive_init_1 (binfo, true_exp, addr, init_list, alias_this)
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
)))
{
...
...
@@ -1803,7 +1800,7 @@ build_member_call (cname, name, parmlist)
{
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
;
...
...
@@ -3114,7 +3111,7 @@ build_new (placement, decl, init, use_global_new)
/* 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
),
...
...
@@ -3151,7 +3148,7 @@ build_new (placement, decl, init, use_global_new)
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
();
...
...
@@ -3179,7 +3176,7 @@ build_new (placement, decl, init, use_global_new)
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
)
...
...
@@ -3273,7 +3270,7 @@ expand_vec_init (decl, base, maxindex, init, from_array)
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
);
...
...
@@ -3357,7 +3354,7 @@ expand_vec_init (decl, base, maxindex, init, from_array)
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
...
...
@@ -3371,7 +3368,7 @@ expand_vec_init (decl, base, maxindex, init, from_array)
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
),
...
...
@@ -3488,7 +3485,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
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
;
}
...
...
@@ -3514,7 +3511,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
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
)
...
...
@@ -3803,7 +3800,7 @@ build_vbase_delete (type, 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
,
...
...
gcc/cp/lex.c
View file @
6060a796
...
...
@@ -2587,6 +2587,15 @@ check_newline ()
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
;
}
...
...
@@ -4874,3 +4883,46 @@ yyerror (string)
error
(
buf
,
token_buffer
);
}
#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 */
gcc/cp/parse.y
View file @
6060a796
...
...
@@ -167,13 +167,14 @@ empty_parms ()
%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> '|'
...
...
@@ -228,7 +229,7 @@ empty_parms ()
%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
...
...
@@ -264,12 +265,16 @@ empty_parms ()
%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
...
...
@@ -313,6 +318,11 @@ extdefs:
{ $<ttype>$ = NULL_TREE; }
;
extdefs_opt:
extdefs
| /* empty */
;
.hush_warning:
{ have_extern_spec = 1;
used_extern_spec = 0;
...
...
@@ -345,9 +355,7 @@ extdef:
| 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 ();
...
...
@@ -355,6 +363,38 @@ extdef:
| 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:
...
...
@@ -462,7 +502,7 @@ template_def:
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);
...
...
@@ -481,7 +521,7 @@ template_def:
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)
{
...
...
@@ -495,7 +535,7 @@ template_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);
...
...
@@ -521,7 +561,7 @@ datadef:
| 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 ';'
{
...
...
@@ -531,7 +571,7 @@ datadef:
| 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 ';'
...
...
@@ -752,11 +792,13 @@ identifier:
IDENTIFIER
| TYPENAME
| PTYPENAME
| NSNAME
;
notype_identifier:
IDENTIFIER
| PTYPENAME %prec EMPTY
| PTYPENAME
| NSNAME %prec EMPTY
;
identifier_defn:
...
...
@@ -939,7 +981,7 @@ condition:
}
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)
...
...
@@ -1225,7 +1267,7 @@ expr_no_commas:
{ $$ = 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); }
*/
...
...
@@ -1236,7 +1278,8 @@ notype_unqualified_id:
{ $$ = build_parse_node (BIT_NOT_EXPR, $3); }
| operator_name
| IDENTIFIER
| PTYPENAME %prec EMPTY
| PTYPENAME
| NSNAME %prec EMPTY
;
unqualified_id:
...
...
@@ -1421,7 +1464,7 @@ primary:
}
#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
...
...
@@ -1659,7 +1702,7 @@ decl:
{ 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);
...
...
@@ -1668,7 +1711,7 @@ decl:
{ 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);
}
...
...
@@ -1899,7 +1942,7 @@ 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; }
| declarator maybe_raises maybeasm maybe_attribute
{ tree d;
...
...
@@ -1916,7 +1959,7 @@ initdcl0:
$$ = 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:
...
...
@@ -1925,11 +1968,11 @@ 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:
...
...
@@ -1940,7 +1983,7 @@ 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;
...
...
@@ -1948,7 +1991,7 @@ notype_initdcl0:
$$ = 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:
...
...
@@ -1959,7 +2002,7 @@ 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;
...
...
@@ -1967,7 +2010,7 @@ nomods_initdcl0:
$$ = 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
...
...
@@ -2569,6 +2612,7 @@ component_decl_1:
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. */
...
...
@@ -2887,6 +2931,8 @@ nested_name_specifier:
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;'
...
...
@@ -3681,13 +3727,13 @@ try_for_typename:
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
, $$);
}
;
...
...
@@ -3696,11 +3742,13 @@ maybe_raises:
{ $$ = 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:
...
...
gcc/cp/pt.c
View file @
6060a796
...
...
@@ -2303,8 +2303,9 @@ do_pending_expansions ()
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?
...
...
gcc/cp/tree.c
View file @
6060a796
...
...
@@ -1503,24 +1503,13 @@ build_exception_variant (ctype, type, raises)
||
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. */
...
...
gcc/cp/typeck.c
View file @
6060a796
...
...
@@ -2162,7 +2162,7 @@ build_x_function_call (function, params, decl)
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
);
}
...
...
@@ -2370,8 +2370,6 @@ build_function_call_real (function, params, require_complete, flags)
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
)
...
...
@@ -2427,7 +2425,6 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
register
tree
typetail
,
valtail
;
register
tree
result
=
NULL_TREE
;
char
*
called_thing
;
int
maybe_raises
=
0
;
int
i
=
0
;
if
(
!
flag_elide_constructors
)
...
...
@@ -2541,8 +2538,6 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
if
(
val
==
error_mark_node
)
continue
;
maybe_raises
|=
TREE_RAISES
(
val
);
if
(
type
!=
0
)
{
/* Formal parm type is specified by a function prototype. */
...
...
@@ -2648,7 +2643,6 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
parmval
=
default_conversion
(
parmval
);
#endif
}
maybe_raises
|=
TREE_RAISES
(
parmval
);
if
(
flag_gc
&&
type_needs_gc_entry
(
TREE_TYPE
(
parmval
))
...
...
@@ -2676,8 +2670,6 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
return
error_mark_list
;
}
}
if
(
result
)
TREE_RAISES
(
result
)
=
maybe_raises
;
return
nreverse
(
result
);
}
...
...
@@ -2733,14 +2725,13 @@ build_binary_op (code, arg1, arg2, convert_p)
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). */
...
...
@@ -3735,7 +3726,7 @@ build_component_addr (arg, argtype, msg)
}
else
/* This conversion is harmless. */
rval
=
convert_force
(
argtype
,
rval
);
rval
=
convert_force
(
argtype
,
rval
,
0
);
if
(
!
integer_zerop
(
DECL_FIELD_BITPOS
(
field
)))
{
...
...
@@ -4871,27 +4862,31 @@ build_compound_expr (list)
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
;
...
...
@@ -5014,7 +5009,7 @@ build_c_cast (type, 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
)
...
...
@@ -5848,7 +5843,7 @@ build_modify_expr (lhs, modifycode, rhs)
{
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"
,
...
...
@@ -6121,7 +6116,7 @@ build_ptrmemfunc (type, pfn, force)
/* 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
,
...
...
@@ -6299,11 +6294,11 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
}
/* 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
c
onvert
(
type
,
rhs
);
return
c
p_convert
(
type
,
rhs
,
CONV_IMPLICIT
,
0
);
}
/* Conversions among pointers */
else
if
(
codel
==
POINTER_TYPE
...
...
@@ -7065,7 +7060,7 @@ c_expand_return (retval)
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
;
...
...
gcc/cp/typeck2.c
View file @
6060a796
...
...
@@ -329,7 +329,7 @@ ack (s, v, v2)
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: 36
1
. Free: */
/* First used: 0 (reserved), Last used: 36
3
. Free: */
static
int
abortcount
=
0
;
...
...
@@ -1430,7 +1430,7 @@ build_functional_cast (exp, parms)
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
)
...
...
@@ -1440,7 +1440,7 @@ build_functional_cast (exp, parms)
}
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment