re PR c++/35331 (ICE with invalid specialization of variadic template)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 12 May 2008 15:18:52 +0000 (15:18 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 12 May 2008 15:18:52 +0000 (15:18 +0000)
/cp
2008-05-12  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/35331
        * semantics.c (begin_class_definition): Extend checks on the first
argument.

/testsuite
2008-05-12  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/35331
        * g++.dg/cpp0x/vt-35331.C: New.
* g++.dg/cpp0x/pr32125.C: Adjust.
* g++.dg/cpp0x/pr32126.C: Likewise.
* g++.dg/cpp0x/pr31438.C: Likewise.
* g++.dg/cpp0x/variadic81.C: Likewise.
* g++.dg/cpp0x/vt-34055.C: Likewise.
* g++.dg/cpp0x/vt-34606.C: Likewise.

From-SVN: r135216

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr31438.C
gcc/testsuite/g++.dg/cpp0x/pr32125.C
gcc/testsuite/g++.dg/cpp0x/pr32126.C
gcc/testsuite/g++.dg/cpp0x/variadic81.C
gcc/testsuite/g++.dg/cpp0x/vt-34055.C
gcc/testsuite/g++.dg/cpp0x/vt-34606.C
gcc/testsuite/g++.dg/cpp0x/vt-35331.C [new file with mode: 0644]

index 85deaa41fe2c95a7e9ea3bf7d1e687fb4b9fc8af..49f91bab0cf7feaa763dbaf9fe9b9d759a1c0fb7 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
+
+        PR c++/35331
+        * semantics.c (begin_class_definition): Extend checks on the first
+       argument.
+
 2008-05-12  Tomas Bily  <tbily@suse.cz>
 
         * typeck2.c (digest_init): Use CONVERT_EXPR_P.
index 7881a9faf1be093dd3241bb0e1fc50e30646bb27..192cfa64197bd57d1de5e6f4740ed9f1d40491fb 100644 (file)
@@ -2223,7 +2223,7 @@ check_template_template_default_arg (tree argument)
 tree
 begin_class_definition (tree t, tree attributes)
 {
-  if (t == error_mark_node)
+  if (error_operand_p (t) || error_operand_p (TYPE_MAIN_DECL (t)))
     return error_mark_node;
 
   if (processing_template_parmlist)
index 79df0e9d453caaf9dfbe114b2c66e35832b94ffa..1daba114a8a892eb22829fc5ab9a987f207c69eb 100644 (file)
@@ -1,3 +1,14 @@
+2008-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
+
+        PR c++/35331
+        * g++.dg/cpp0x/vt-35331.C: New.        
+       * g++.dg/cpp0x/pr32125.C: Adjust.
+       * g++.dg/cpp0x/pr32126.C: Likewise.
+       * g++.dg/cpp0x/pr31438.C: Likewise.
+       * g++.dg/cpp0x/variadic81.C: Likewise.
+       * g++.dg/cpp0x/vt-34055.C: Likewise.
+       * g++.dg/cpp0x/vt-34606.C: Likewise.
+
 2008-05-12  Ira Rosen  <irar@il.ibm.com>
 
        * gfortran.dg/vect/pr36119.f: Rename to ...
index 4763918b0ef897bc9c7132ba3aa08113b5af9f4d..74738830ad16735d86d76995ce8e266a2a3c92df 100644 (file)
@@ -2,8 +2,8 @@
 
 template<typename> struct A;
 template<typename T, typename... U> struct A<T(U)> // { dg-error "parameter packs|U" }
-{     // { dg-error "parameter packs|U" }
- template<typename X> A(X); // { dg-error "parameter packs|U" }
+{
+ template<typename X> A(X);
 };
 
 A<void(int)> a(0); // { dg-error "incomplete type" }
index 048cf454484096f1be003630cfef9197d98495ac..210a29c0829d7da264e057893eee329b0eda7380 100644 (file)
@@ -2,7 +2,7 @@
 template<typename...> struct A;
 
 template<typename...T> struct A<T*> // { dg-error "not expanded|T" }
-{       // { dg-error "not expanded|T" }
-  A();  // { dg-error "not expanded|T" }
-  A(T); // { dg-error "not expanded|T" }
+{
+  A();
+  A(T);
 };
index a344567dff9a65117bc518678c90e006ef601b55..c525cca684b16cd377c7e15944cf642a6c75f906 100644 (file)
@@ -2,7 +2,7 @@
 template<typename...> struct A;
 
 template<typename...T> struct A<T> // { dg-error "not expanded|T|" }
-{ // { dg-error "not expanded|T|" }
+{
  static int i;
 };
 
index c5673789ca987da8231846edfc00ec3ad0be1ed9..cce61b316490da2fd28170a509c9feb88ca4a02a 100644 (file)
@@ -4,7 +4,7 @@
 template<typename> struct A;
 
 template<typename... T> struct A<T*>  // { dg-error "not expanded|T|not used|T" }
-{                                     // { dg-error "not expanded|T|not used|T" }
+{
   struct B;
 };
 
index 29066b50bd72ff9cce1fa08574ffc8739c40ba0c..c50778430e0a05a67c655dd176b4b7b6bde7ce0c 100644 (file)
@@ -3,8 +3,8 @@
 template<typename...> struct A;
 
 template<typename...T> struct A<T*> // { dg-error "parameter packs|T" }
-{   // { dg-error "parameter packs|T" }
-  void foo();  // { dg-error "parameter packs|T|candidate" }
+{
+  void foo();
 };
 
 template<typename...T> void A<T*>::foo() {} // { dg-error "invalid declarator" }
@@ -14,8 +14,8 @@ template<typename...T> void A<T*>::foo() {} // { dg-error "invalid declarator" }
 template<typename...> struct B;
 
 template<typename...T> struct B<T&> // { dg-error "parameter packs|T" }
-{ // { dg-error "parameter packs|T" }
-  void foo(); // { dg-error "parameter packs|T" }
+{
+  void foo();
 };
 
 template<typename...T> void B<T&>::foo() {} // { dg-error "invalid declarator" }
@@ -24,8 +24,8 @@ template<typename...T> void B<T&>::foo() {} // { dg-error "invalid declarator" }
 template<typename...> struct C;
 
 template<typename...T> struct C<T()> // { dg-error "parameter packs|T" }
-{ // { dg-error "parameter packs|T" }
-  void foo(); // { dg-error "parameter packs|T" }
+{
+  void foo();
 };
 
 template<typename...T> void C<T()>::foo() {} // { dg-error "invalid declarator" }
index f62e2d54118c80889e317d2d870649dc91da12ed..467943354424be85b82e35742ee0783abc5dcca2 100644 (file)
@@ -2,8 +2,8 @@
 template<typename...> struct A;
 
 template<typename T, typename... U> struct A<T, U> // { dg-error "parameter packs|U" }
-{  // { dg-error "parameter packs|U" }
+{
   template<typename> struct B;
 
-  template<typename X> struct B<X*> {};  // { dg-error "parameter packs|U" }
+  template<typename X> struct B<X*> {};
 };
diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-35331.C b/gcc/testsuite/g++.dg/cpp0x/vt-35331.C
new file mode 100644 (file)
index 0000000..0add981
--- /dev/null
@@ -0,0 +1,7 @@
+// { dg-options "-std=c++0x" }
+template<typename...> struct A;
+
+template<typename...T> struct A<T*> // { dg-error "not expanded|T" }
+{
+  friend void foo();
+};