diff options
author | Dodji Seketeli <dodji@redhat.com> | 2010-01-18 23:14:01 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@redhat.com> | 2010-01-18 23:14:01 +0000 |
commit | 080d992485c0266fd9dc79e511a4e69cc17243cc (patch) | |
tree | fa4e131e26a1ce6f2f7de411de613d597b36a2f7 | |
parent | eb87b1d22029d3efcad39c2d539a1629433d6953 (diff) |
Revert fix of PR c++/
gcc/cp/ChangeLog:
* error.c (dump_template_parms, count_non_default_template_args):
Revert fix of PR c++/42634.
gcc/testsuite/ChangeLog:
* g++.dg/template/error45.C: reverted as part of reverting the
fix of PR c++/42634.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@156026 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/error.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/error45.C | 34 |
4 files changed, 14 insertions, 37 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5325a6c9e14..f9422b2dcd7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-01-19 Dodji Seketeli <dodji@redhat.com> + + * error.c (dump_template_parms, count_non_default_template_args): + Revert fix of PR c++/42634. + 2010-01-18 Dodji Seketeli <dodji@redhat.com> PR c++/42634 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 53832515405..e48b9938455 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-01-19 Dodji Seketeli <dodji@redhat.com> + + * g++.dg/template/error45.C: reverted as part of reverting the + fix of PR c++/42634. + 2010-01-18 Dodji Seketeli <dodji@redhat.com> PR c++/42634 diff --git a/gcc/testsuite/g++.dg/template/error45.C b/gcc/testsuite/g++.dg/template/error45.C deleted file mode 100644 index f5332ee7144..00000000000 --- a/gcc/testsuite/g++.dg/template/error45.C +++ /dev/null @@ -1,34 +0,0 @@ -// 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()); -} - |