mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-26 21:33:59 +08:00
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
This commit is contained in:
parent
975c6e4e67
commit
0abc082acf
@ -1,5 +1,8 @@
|
||||
2002-05-03 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* tree.c (build_cplus_array_type): Only const and volatile get
|
||||
special handling.
|
||||
|
||||
* decl.c (BOOL_TYPE_SIZE): Move default to defaults.h.
|
||||
|
||||
2002-04-30 Mark Mitchell <mark@codesourcery.com>
|
||||
|
@ -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;
|
||||
}
|
||||
|
8
gcc/testsuite/g++.dg/template/restrict1.C
Normal file
8
gcc/testsuite/g++.dg/template/restrict1.C
Normal file
@ -0,0 +1,8 @@
|
||||
// PR c++/6392
|
||||
// Bug: We tried to make the array restricted, which doesn't make sense.
|
||||
|
||||
template <class T>
|
||||
class bob
|
||||
{
|
||||
T * __restrict a[50];
|
||||
};
|
Loading…
Reference in New Issue
Block a user