aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-10-23 02:26:32 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-10-22 22:26:32 -0400
commit0aaa90896608511a17211385ede533ef5b46327e (patch)
treec6e279b75c6748b8d90e4110fed1fe27a545da3d /gcc/cp/tree.c
parentccb5954fea236ccb5e521b1d644962959daced28 (diff)
downloadgcc-0aaa90896608511a17211385ede533ef5b46327e.zip
gcc-0aaa90896608511a17211385ede533ef5b46327e.tar.gz
gcc-0aaa90896608511a17211385ede533ef5b46327e.tar.bz2
cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays.
* cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays. (CP_TYPE_VOLATILE): Likewise. * decl.c (grokdeclarator): Use them. * tree.c (canonical_type_variant): Likewise. From-SVN: r23244
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index b943b83..15be5d7 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -501,18 +501,8 @@ tree
canonical_type_variant (t)
tree t;
{
- int constp, volatilep;
- if (TREE_CODE (t) == ARRAY_TYPE)
- {
- constp = TYPE_READONLY (TREE_TYPE (t));
- volatilep = TYPE_VOLATILE (TREE_TYPE (t));
- }
- else
- {
- constp = TYPE_READONLY (t);
- volatilep = TYPE_VOLATILE (t);
- }
- return cp_build_type_variant (TYPE_MAIN_VARIANT (t), constp, volatilep);
+ return cp_build_type_variant (TYPE_MAIN_VARIANT (t), CP_TYPE_READONLY (t),
+ CP_TYPE_VOLATILE (t));
}
/* Add OFFSET to all base types of T.