re PR c++/51416 ([c++0x] [4.6/4.7 Regression] ICE with invalid use of auto)
authorJason Merrill <jason@redhat.com>
Sat, 17 Dec 2011 03:28:39 +0000 (22:28 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 17 Dec 2011 03:28:39 +0000 (22:28 -0500)
PR c++/51416
* init.c (build_value_init_noctor): Check for incomplete type.

From-SVN: r182430

gcc/cp/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/auto31.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/variadic103.C

index 9c847d44f73ebb05bb72d96474e8df4da07f11e4..6ed8a03ebe92198fa1a686dc41766eee8d61491d 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51416
+       * init.c (build_value_init_noctor): Check for incomplete type.
+
 2011-12-16  Richard Henderson  <rth@redhat.com>
 
        PR bootstrap/51072
index 0a22ca936f35e30318012904094ffd87130c2af7..f2878ef6941d3ee1103d3a221fd02bfa8959dac1 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51416
+       * g++.dg/cpp0x/auto31.C: New.
+
 2011-12-16  Ian Lance Taylor  <iant@google.com>
 
        PR middle-end/51592
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto31.C b/gcc/testsuite/g++.dg/cpp0x/auto31.C
new file mode 100644 (file)
index 0000000..26a6560
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/51416
+// { dg-do compile { target c++11 } }
+
+template<typename T, typename... U> void foo(T, U... u)
+{
+  auto foo(u...);              // { dg-error "auto" }
+}
+
+void bar()
+{
+  foo(0);
+}
index 6d12331d000d59f1dcee2f35fa02c9e036ae584c..9d6b5ea20b85275dc5f1038f4a3bdbae200ffad6 100644 (file)
@@ -5,7 +5,7 @@ T&& create();
 
 template<class T, class... Args>
 void test() {
-  T t(create<Args>()...);      // { dg-error "unknown bound" }
+  T t(create<Args>()...);      // { dg-error "incomplete" }
   (void) t;
 }