re PR c++/34917 (ICE with const vector)

PR c++/34917
	* tree.c (build_type_attribute_qual_variant): Call
	build_qualified_type if attributes are equal, but quals are not.

	* g++.dg/ext/vector12.C: New test.

From-SVN: r131726
This commit is contained in:
Jakub Jelinek 2008-01-22 17:18:14 +01:00 committed by Jakub Jelinek
parent 29b0d1fd13
commit 42a89d2d54
4 changed files with 17 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2008-01-22 Jakub Jelinek <jakub@redhat.com>
PR c++/34917
* tree.c (build_type_attribute_qual_variant): Call
build_qualified_type if attributes are equal, but quals are not.
2008-01-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 32102

View file

@ -1,3 +1,8 @@
2008-01-22 Jakub Jelinek <jakub@redhat.com>
PR c++/34917
* g++.dg/ext/vector12.C: New test.
2008-01-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 32102

View file

@ -0,0 +1,4 @@
// PR c++/34917
// { dg-do compile }
const int i __attribute ((vector_size (8))) = {};

View file

@ -3735,6 +3735,8 @@ build_type_attribute_qual_variant (tree ttype, tree attribute, int quals)
ttype = build_qualified_type (ntype, quals);
}
else if (TYPE_QUALS (ttype) != quals)
ttype = build_qualified_type (ttype, quals);
return ttype;
}