aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-05-14 10:49:45 -0400
committerJason Merrill <jason@gcc.gnu.org>2018-05-14 10:49:45 -0400
commit403962eac2c99fc7510fbd4164f0a56fb7a15d0c (patch)
treeeea7a98609a76102c16b62cf557dcee6cb9af004 /gcc/testsuite/g++.dg
parent3846b8e4b37aabba4c85d14078d041020d363fb8 (diff)
downloadgcc-403962eac2c99fc7510fbd4164f0a56fb7a15d0c.zip
gcc-403962eac2c99fc7510fbd4164f0a56fb7a15d0c.tar.gz
gcc-403962eac2c99fc7510fbd4164f0a56fb7a15d0c.tar.bz2
pt.c (tsubst): Check valid_array_size_p.
* pt.c (tsubst) [ARRAY_TYPE]: Check valid_array_size_p. (tsubst_copy_and_build) [NEW_EXPR]: Clear in_decl. gcc/c-family/ * c-common.c (valid_array_size_p): Add complain parameter. * c-common.h: ...which defaults to true. From-SVN: r260227
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r--gcc/testsuite/g++.dg/init/new38.C6
-rw-r--r--gcc/testsuite/g++.dg/template/array30.C7
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/testsuite/g++.dg/init/new38.C b/gcc/testsuite/g++.dg/init/new38.C
index 37da525..a03e231 100644
--- a/gcc/testsuite/g++.dg/init/new38.C
+++ b/gcc/testsuite/g++.dg/init/new38.C
@@ -22,7 +22,7 @@ template <typename T>
void
large_array_template1(int n)
{
- new T[n] // { dg-error "size of array is too large" }
+ new T[n] // { dg-error "size of unnamed array is too large" }
[(1ULL << (sizeof(void *) * 4)) / sizeof(T)]
[1ULL << (sizeof(void *) * 4)];
}
@@ -31,7 +31,7 @@ template <typename T>
void
large_array_template2(int n)
{
- new T[n] // { dg-error "size of array is too large" }
+ new T[n] // { dg-error "size of unnamed array is too large" }
[(1ULL << (sizeof(void *) * 4)) / sizeof(T)]
[1ULL << (sizeof(void *) * 4)];
}
@@ -40,7 +40,7 @@ template <typename T>
void
large_array_template3(int n)
{
- new T[n] // { dg-error "size of array is too large" }
+ new T[n] // { dg-error "size of unnamed array is too large" }
[(1ULL << (sizeof(void *) * 4)) / sizeof(T)]
[1ULL << (sizeof(void *) * 4)];
}
diff --git a/gcc/testsuite/g++.dg/template/array30.C b/gcc/testsuite/g++.dg/template/array30.C
new file mode 100644
index 0000000..3608c2e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/array30.C
@@ -0,0 +1,7 @@
+template <int I>
+struct A
+{
+ int ar[I][I][I][I][I][I][I][I][I][I]; // { dg-error "too large" }
+};
+
+A<66000> a;