aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2001-08-24 08:07:46 -0400
committerJason Merrill <jason@gcc.gnu.org>2001-08-24 08:07:46 -0400
commit0213a355281c1ce387d9fae4061d18f6b9bcd54e (patch)
treeadef91f04544976faec6a008d13e5bd087582d2d /gcc/cp/tree.c
parent2dc8352c90590135507210ce0638d31eaec88d0e (diff)
downloadgcc-0213a355281c1ce387d9fae4061d18f6b9bcd54e.zip
gcc-0213a355281c1ce387d9fae4061d18f6b9bcd54e.tar.gz
gcc-0213a355281c1ce387d9fae4061d18f6b9bcd54e.tar.bz2
c-common.c (c_alignof, [...]): Move here...
* c-common.c (c_alignof, c_alignof_expr): Move here... * c-typeck.c: ...from here. * c-tree.h, c-common.h: Adjust. * tree.c (cp_build_qualified_type_real): Use get_qualified_type. (build_cplus_array_type): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT, to get an unqualified version. * decl2.c (grok_alignof): Lose. (build_expr_from_tree): Use expr_sizeof and c_alignof_expr. * typeck.c (c_alignof): Lose. * semantics.c (finish_sizeof, finish_alignof): New. * parse.y: Use them. * cp-tree.h: Declare them. From-SVN: r45145
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 40a2d55..f5c6510 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -487,7 +487,8 @@ build_cplus_array_type (elt_type, index_type)
tree t;
int type_quals = CP_TYPE_QUALS (elt_type);
- elt_type = TYPE_MAIN_VARIANT (elt_type);
+ if (type_quals != TYPE_UNQUALIFIED)
+ elt_type = cp_build_qualified_type (elt_type, TYPE_UNQUALIFIED);
t = build_cplus_array_type_1 (elt_type, index_type);
@@ -557,9 +558,7 @@ cp_build_qualified_type_real (type, type_quals, complain)
return error_mark_node;
/* See if we already have an identically qualified type. */
- for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
- if (CP_TYPE_QUALS (t) == type_quals)
- break;
+ t = get_qualified_type (type, type_quals);
/* If we didn't already have it, create it now. */
if (!t)