aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-10-16 10:36:06 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-10-16 10:36:06 +0200
commit126c1ea158ebd9ecead98bb8ec61e55ba15d57eb (patch)
tree4434db790262e0a46db2f611c6b5089797190051
parent6fba3d61eff769b078ec1cbfcdf21fb1351742f7 (diff)
downloadgcc-126c1ea158ebd9ecead98bb8ec61e55ba15d57eb.zip
gcc-126c1ea158ebd9ecead98bb8ec61e55ba15d57eb.tar.gz
gcc-126c1ea158ebd9ecead98bb8ec61e55ba15d57eb.tar.bz2
re PR c++/53574 (ICE with -fstack-usage)
PR c++/53574 * g++.dg/other/pr53574.C: New test. From-SVN: r253778
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/other/pr53574.C48
2 files changed, 53 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3458692..e210413 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/53574
+ * g++.dg/other/pr53574.C: New test.
+
2017-10-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61323
diff --git a/gcc/testsuite/g++.dg/other/pr53574.C b/gcc/testsuite/g++.dg/other/pr53574.C
new file mode 100644
index 0000000..cc899a5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr53574.C
@@ -0,0 +1,48 @@
+// PR c++/53574
+// { dg-do compile { target c++11 } }
+// { dg-options "-fstack-usage" }
+
+template <typename> struct A { typedef int type; };
+struct B {
+ typedef __SIZE_TYPE__ H;
+};
+template <typename> class allocator : B {};
+template <typename _Alloc> struct C {
+ template <typename T>
+ static typename T::H foo(T *);
+ typedef decltype(foo((_Alloc *)0)) H;
+ template <typename U>
+ static typename A<H>::type bar(U) { return typename A<H>::type (); }
+ static int baz(_Alloc p1) { bar(p1); return 0; }
+};
+template <typename _Alloc> struct I : C<_Alloc> {};
+template <typename, typename> struct J {
+ typedef I<allocator<int>> K;
+ K k;
+};
+struct D : J<int, allocator<int>> {
+ void fn(int, int) {
+ K m;
+ I<K>::baz(m);
+ }
+};
+template <class Ch, class = int, class = int> struct F {
+ F();
+ F(const Ch *);
+ F test();
+ D d;
+};
+int l;
+struct G {
+ G(F<char>);
+};
+char n;
+template <class Ch, class Tr, class Alloc> F<Ch, Tr, Alloc>::F(const Ch *) {
+ test();
+}
+template <class Ch, class Tr, class Alloc>
+F<Ch, Tr, Alloc> F<Ch, Tr, Alloc>::test() {
+ d.fn(l, 0);
+ return F<Ch, Tr, Alloc> ();
+}
+G fn1() { return G(&n); }