diff options
author | Mike Stump <mrs@gcc.gnu.org> | 1996-03-22 23:11:55 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 1996-03-22 23:11:55 +0000 |
commit | 909e536aa51ba1dba536cb905dc8854c8b487738 (patch) | |
tree | be761953f8502bf4503be31fb1298c410a2271e2 /gcc | |
parent | c7b1ed2b88ec0e8079c07ce759c73b83ded3b41c (diff) | |
download | gcc-909e536aa51ba1dba536cb905dc8854c8b487738.zip gcc-909e536aa51ba1dba536cb905dc8854c8b487738.tar.gz gcc-909e536aa51ba1dba536cb905dc8854c8b487738.tar.bz2 |
85th Cygnus<->FSF quick merge
From-SVN: r11597
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/cp/decl.c | 3 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 22 | ||||
-rw-r--r-- | gcc/cp/gxxint.texi | 2 | ||||
-rw-r--r-- | gcc/cp/pt.c | 8 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 2 |
6 files changed, 46 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3434665..fd4720c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,24 @@ +Fri Mar 22 13:48:29 1996 Jason Merrill <jason@yorick.cygnus.com> + + * pt.c (tsubst, case TYPE_DECL): Set DECL_CONTEXT. + + * typeck.c (require_complete_type): Be sure to instantiate the + MAIN_VARIANT of the type. + + * decl2.c (finish_file): Instantiate pending templates before + processing static constructors and destructors. + + * pt.c (instantiate_decl): Don't instantiate functions at toplevel + unless at_eof. + +Fri Mar 22 09:30:17 1996 Bob Manson <manson@beauty.cygnus.com> + + * decl2.c (delete_sanity): If error_mark_node is passed + in as an expression, quit while we're ahead. + + * decl.c (grokdeclarator): Give an error message if `friend' + is combined with any storage class specifiers. + Wed Mar 20 14:51:55 1996 Jason Merrill <jason@yorick.cygnus.com> * parse.y (named_complex_class_head_sans_basetype): Don't crash on diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9855bac..10cf2a6 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8268,6 +8268,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, raises, attrli error ("top-level declaration of `%s' specifies `auto'", name); } + if (nclasses > 0 && friendp) + error ("storage class specifiers invalid in friend function declarations"); + /* Now figure out the structure of the declarator proper. Descend through it, creating more complex types, until we reach the declared identifier (or NULL_TREE, in an absolute declarator). */ diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a902a4f..8077b5b 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1124,6 +1124,9 @@ delete_sanity (exp, size, doing_vec, use_global_delete) this down as a NULL_TREE into build_vec_delete. */ tree maxindex = NULL_TREE; + if (exp == error_mark_node) + return exp; + if (current_template_parms) { t = build_min (DELETE_EXPR, void_type_node, exp, size); @@ -2822,10 +2825,6 @@ finish_file () start_time = get_run_time (); - /* Push into C language context, because that's all - we'll need here. */ - push_lang_context (lang_name_c); - /* Otherwise, GDB can get confused, because in only knows about source for LINENO-1 lines. */ lineno -= 1; @@ -2833,6 +2832,16 @@ finish_file () interface_unknown = 1; interface_only = 0; + for (fnname = pending_templates; fnname; fnname = TREE_CHAIN (fnname)) + { + tree decl = TREE_VALUE (fnname); + instantiate_decl (decl); + } + + /* Push into C language context, because that's all + we'll need here. */ + push_lang_context (lang_name_c); + #if 1 /* The reason for pushing garbage onto the global_binding_level is to ensure that we can slice out _DECLs which pertain to virtual function @@ -3082,11 +3091,6 @@ finish_file () if (flag_handle_signatures) walk_sigtables ((void (*)())0, finish_sigtable_vardecl); - for (fnname = pending_templates; fnname; fnname = TREE_CHAIN (fnname)) - { - tree decl = TREE_VALUE (fnname); - instantiate_decl (decl); - } for (fnname = saved_inlines; fnname; fnname = TREE_CHAIN (fnname)) { tree decl = TREE_VALUE (fnname); diff --git a/gcc/cp/gxxint.texi b/gcc/cp/gxxint.texi index 64d9776..5fedd5a 100644 --- a/gcc/cp/gxxint.texi +++ b/gcc/cp/gxxint.texi @@ -1226,7 +1226,7 @@ stands. Only exact type matching or reference matching of throw types works when -fno-rtti is used. Only works on a SPARC (like Suns), i386, arm, -rs6000, PowerPC, Alpha, mips, VAX, and m68k machines. Partial support +rs6000, PowerPC, Alpha, mips, VAX, m68k and z8k machines. Partial support is in for all other machines, but a stack unwinder called __unwind_function has to be written, and added to libgcc2 for them. The new EH code doesn't rely upon the __unwind_function for C++ code, diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 0ecc4001..f3307a1 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1566,6 +1566,7 @@ tsubst (t, args, nargs, in_decl) { tree r = copy_node (t); TREE_TYPE (r) = type; + DECL_CONTEXT (r) = current_class_type; set_nested_typename (r, current_class_name, DECL_NAME (r), type); TREE_CHAIN (r) = NULL_TREE; return r; @@ -2935,7 +2936,12 @@ instantiate_decl (d) if (! pattern_defined || (TREE_CODE (d) == FUNCTION_DECL && ! DECL_INLINE (d) && (! DECL_INTERFACE_KNOWN (d) - || ! DECL_NOT_REALLY_EXTERN (d)))) + || ! DECL_NOT_REALLY_EXTERN (d))) + /* Kludge: if we compile a constructor in the middle of processing a + toplevel declaration, we blow away the declspecs in + temp_decl_obstack when we call permanent_allocation in + finish_function. So don't compile it yet. */ + || (TREE_CODE (d) == FUNCTION_DECL && ! nested && ! at_eof)) { add_pending_template (d); return d; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 44e05b8..498f293 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -112,7 +112,7 @@ require_complete_type (value) if (IS_AGGR_TYPE (type) && CLASSTYPE_TEMPLATE_INSTANTIATION (type)) { - instantiate_class_template (type); + instantiate_class_template (TYPE_MAIN_VARIANT (type)); if (TYPE_SIZE (type) != 0) return value; } |