This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH for c++/58273 (bogus error with non-dependent call in template)
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 13 Sep 2013 15:08:20 -0400
- Subject: C++ PATCH for c++/58273 (bogus error with non-dependent call in template)
- Authentication-results: sourceware.org; auth=none
A simple cut-and-paste error. When I copied
any_value_dependent_elements_p to any_type_dependent_elements_p, I
should have changed the body of the function as well...
Tested x86_64-pc-linux-gnu, applying to trunk, 4.8, 4.7.
commit 0515f1a9424ba750c345826d5504aecb6e23b8e0
Author: Jason Merrill <jason@redhat.com>
Date: Thu Sep 12 18:22:17 2013 -0400
PR c++/58273
* pt.c (any_type_dependent_elements_p): Actually check for
type-dependence, not value-dependence.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 3ae679a..d560e3c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -20456,7 +20456,7 @@ bool
any_type_dependent_elements_p (const_tree list)
{
for (; list; list = TREE_CHAIN (list))
- if (value_dependent_expression_p (TREE_VALUE (list)))
+ if (type_dependent_expression_p (TREE_VALUE (list)))
return true;
return false;
diff --git a/gcc/testsuite/g++.dg/template/inherit9.C b/gcc/testsuite/g++.dg/template/inherit9.C
new file mode 100644
index 0000000..926343b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/inherit9.C
@@ -0,0 +1,15 @@
+// PR c++/58273
+
+class A {};
+class B
+{
+ int goo(A);
+};
+template<typename E>
+class D : public B
+{
+ void foo(A t)
+ {
+ int const i(B::goo(t));
+ }
+};