From: Dodji Seketeli Date: Fri, 15 Jan 2010 11:23:29 +0000 (+0000) Subject: Revert commit of PR c++/42634, which was commit r155868 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=58be9ce9c30e0b16d4d4cb6ccccc4b910b8ae834;hp=cbe80ff86790257e3d0bf5a704ce3b1501c2cc37;p=gcc.git Revert commit of PR c++/42634, which was commit r155868 From-SVN: r155936 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1d132616371..9f73d86c22e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-01-15 Dodji Seketeli + + * error.c (dump_template_parms,count_non_default_template_args): + Revert changes of PR c++/42634. + 2010-01-14 Jakub Jelinek PR middle-end/42674 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 54e96810f9b..e0e5ae52ceb 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 14310b16781..ba2aa6cc848 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-01-15 Dodji Seketeli + + * g++.dg/template/error45.C: Revert as part of reverting changes + or PR c++/42634. + 2010-01-14 Jerry DeLisle 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 index 3bd8fb4e714..00000000000 --- a/gcc/testsuite/g++.dg/template/error45.C +++ /dev/null @@ -1,35 +0,0 @@ -// Contributed by Dodji Seketeli -// Origin PR c++/42634 -// { dg-options "-g -std=gnu++0x" } -// { dg-do compile } - -template T declval(); - -template struct is_constructible { - template static decltype(T1(declval()...), char()) test(); - static const bool value = sizeof(test()) == 1; -}; -template struct enable_if { - typedef void type; -}; -template struct pair { - template::value>::type - > - pair(const T1&, U2&&) { } -}; -struct string { - string() : p(0) {} - char* p; -}; - -struct Foo { - string s; - int i; -}; - -void f() -{ - pair(1, Foo()); -} -