Revert commit of PR c++/42634, which was commit r155868
authorDodji Seketeli <dodji@redhat.com>
Fri, 15 Jan 2010 11:23:29 +0000 (11:23 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Fri, 15 Jan 2010 11:23:29 +0000 (12:23 +0100)
From-SVN: r155936

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/error45.C [deleted file]

index 1d1326163710f691fd85feee8d81ed537faff9c9..9f73d86c22e7ff70ab63eac20ce5b1caf5135b08 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-15  Dodji Seketeli  <dodji@redhat.com>
+
+       * error.c (dump_template_parms,count_non_default_template_args):
+       Revert changes of PR c++/42634.
+
 2010-01-14  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/42674
index 54e96810f9bc696ce43e818a0e75893bbe021c24..e0e5ae52ceb73f90b739655b92a4add6acd3141e 100644 (file)
@@ -165,7 +165,8 @@ dump_template_argument (tree arg, int flags)
 static int
 count_non_default_template_args (tree args, tree params, int flags)
 {
-  int n = TREE_VEC_LENGTH (args);
+  tree inner_args = INNERMOST_TEMPLATE_ARGS (args);
+  int n = TREE_VEC_LENGTH (inner_args);
   int last;
 
   if (params == NULL_TREE
@@ -194,7 +195,7 @@ count_non_default_template_args (tree args, tree params, int flags)
                                       NULL_TREE, false, true);
          --processing_template_decl;
        }
-      if (!cp_tree_equal (TREE_VEC_ELT (args, last), def))
+      if (!cp_tree_equal (TREE_VEC_ELT (inner_args, last), def))
         break;
     }
 
@@ -1491,9 +1492,9 @@ dump_template_parms (tree info, int primary, int flags)
                     ? DECL_INNERMOST_TEMPLATE_PARMS (TI_TEMPLATE (info))
                     : NULL_TREE);
 
-      args = INNERMOST_TEMPLATE_ARGS (args);
       len = count_non_default_template_args (args, params, flags);
 
+      args = INNERMOST_TEMPLATE_ARGS (args);
       for (ix = 0; ix != len; ix++)
        {
          tree arg = TREE_VEC_ELT (args, ix);
index 14310b16781f9481d64435762f139bf1739e6526..ba2aa6cc848a4304551d326bf03992ff703f2ca3 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-15  Dodji Seketeli  <dodji@redhat.com>
+
+       * g++.dg/template/error45.C: Revert as part of reverting changes
+       or PR c++/42634.
+
 2010-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
 
        PR fortran/42684
diff --git a/gcc/testsuite/g++.dg/template/error45.C b/gcc/testsuite/g++.dg/template/error45.C
deleted file mode 100644 (file)
index 3bd8fb4..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Contributed by Dodji Seketeli <dodji@redhat.com>
-// Origin PR c++/42634
-// { dg-options "-g -std=gnu++0x" }
-// { dg-do compile }
-
-template<typename T> T declval();
-
-template<typename T, typename... Args> struct is_constructible {
-    template<typename T1, typename... Args1> static decltype(T1(declval<Args1>()...), char()) test();
-    static const bool value = sizeof(test<T, Args...>()) == 1;
-};
-template<bool> struct enable_if {
-        typedef void type;
-};
-template<class T1, class T2> struct pair {
-    template<class U2,
-             class = typename enable_if<is_constructible<T2,U2&&>::value>::type
-             >
-    pair(const T1&, U2&&) { }
-};
-struct string {
-  string() : p(0) {}
-  char* p;
-};
-
-struct Foo {
-  string s;
-  int i;
-};
-
-void f()
-{
-  pair<int, Foo>(1, Foo());
-}
-