diff options
author | Jason Merrill <jason@redhat.com> | 2002-05-03 12:22:08 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-05-03 12:22:08 -0400 |
commit | 0abc082acf3728d036fbc3d2fd67a115fa044409 (patch) | |
tree | 1630323e1f83e49e1cf6d97a3f324088f130d6ac /gcc/cp/tree.c | |
parent | 975c6e4e679c22ad01fc5fc57c9a1a4d504c58ee (diff) | |
download | gcc-0abc082acf3728d036fbc3d2fd67a115fa044409.zip gcc-0abc082acf3728d036fbc3d2fd67a115fa044409.tar.gz gcc-0abc082acf3728d036fbc3d2fd67a115fa044409.tar.bz2 |
tree.c (build_cplus_array_type): Only const and volatile get special handling.
* tree.c (build_cplus_array_type): Only const and volatile get
special handling.
From-SVN: r53098
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index cdf9d75..02d5a4b 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -495,14 +495,16 @@ build_cplus_array_type (elt_type, index_type) { tree t; int type_quals = cp_type_quals (elt_type); + int cv_quals = type_quals & (TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE); + int other_quals = type_quals & ~(TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE); - if (type_quals != TYPE_UNQUALIFIED) - elt_type = cp_build_qualified_type (elt_type, TYPE_UNQUALIFIED); + if (cv_quals) + elt_type = cp_build_qualified_type (elt_type, other_quals); t = build_cplus_array_type_1 (elt_type, index_type); - if (type_quals != TYPE_UNQUALIFIED) - t = cp_build_qualified_type (t, type_quals); + if (cv_quals) + t = cp_build_qualified_type (t, cv_quals); return t; } |