diff options
author | Nathan Sidwell <nathan@acm.org> | 1999-05-28 01:56:31 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 1999-05-28 01:56:31 +0000 |
commit | 6ab5c7408e03821425a8e36fc9f69c26fac50c52 (patch) | |
tree | 9791b3b59a56e1f45b6babe5c71b68fc3b150ecb | |
parent | 9cb15ab62fc0326dc0be48ac872c1d4e9e44a7b7 (diff) | |
download | gcc-6ab5c7408e03821425a8e36fc9f69c26fac50c52.zip gcc-6ab5c7408e03821425a8e36fc9f69c26fac50c52.tar.gz gcc-6ab5c7408e03821425a8e36fc9f69c26fac50c52.tar.bz2 |
decl.c (complete_array_type): Allocate off same obstack.
* decl.c (complete_array_type): Allocate off same obstack. Fix
DO_DEFAULT comment to match reality.
* friend.c (make_friend_class): Fix diagnostic typo.
From-SVN: r27210
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/decl.c | 20 | ||||
-rw-r--r-- | gcc/cp/friend.c | 2 |
3 files changed, 22 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 301199a..f6496ec 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +1999-05-28 Nathan Sidwell <nathan@acm.org> + + * decl.c (complete_array_type): Allocate off same obstack. Fix + DO_DEFAULT comment to match reality. + + * friend.c (make_friend_class): Fix diagnostic typo. + 1999-05-28 Mark Mitchell <mark@codesourcery.com> * decl.c (lookup_namespace_name): Handle getting a diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0b2d588..ea6acd7 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8558,7 +8558,7 @@ expand_static_init (decl, init) /* Make TYPE a complete type based on INITIAL_VALUE. Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered, - 2 if there was no information (in which case assume 1 if DO_DEFAULT). */ + 2 if there was no information (in which case assume 0 if DO_DEFAULT). */ int complete_array_type (type, initial_value, do_default) @@ -8567,7 +8567,10 @@ complete_array_type (type, initial_value, do_default) { register tree maxindex = NULL_TREE; int value = 0; - + + /* Allocate on the same obstack as TYPE. */ + push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type)); + if (initial_value) { /* Note MAXINDEX is really the maximum index, @@ -8615,23 +8618,28 @@ complete_array_type (type, initial_value, do_default) if (maxindex) { tree itype; + tree domain; + + domain = build_index_type (maxindex); + TYPE_DOMAIN (type) = domain; - TYPE_DOMAIN (type) = build_index_type (maxindex); if (! TREE_TYPE (maxindex)) - TREE_TYPE (maxindex) = TYPE_DOMAIN (type); + TREE_TYPE (maxindex) = domain; if (initial_value) itype = TREE_TYPE (initial_value); else itype = NULL; if (itype && !TYPE_DOMAIN (itype)) - TYPE_DOMAIN (itype) = TYPE_DOMAIN (type); + TYPE_DOMAIN (itype) = domain; /* The type of the main variant should never be used for arrays of different sizes. It should only ever be completed with the size of the array. */ if (! TYPE_DOMAIN (TYPE_MAIN_VARIANT (type))) - TYPE_DOMAIN (TYPE_MAIN_VARIANT (type)) = TYPE_DOMAIN (type); + TYPE_DOMAIN (TYPE_MAIN_VARIANT (type)) = domain; } + pop_obstacks(); + /* Lay out the type now that we can get the real answer. */ layout_type (type); diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 07cda8f..a2d0c4d 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -296,7 +296,7 @@ make_friend_class (type, friend_type) template <class T> friend typename S<T>::X; which isn't any of these. */ - cp_error ("typename type `%T' declare `friend'", + cp_error ("typename type `%T' declared `friend'", friend_type); return; } |