diff mbox

C++ PATCH for c++/58273 (bogus error with non-dependent call in template)

Message ID 523362A4.2050809@redhat.com
State New
Headers show

Commit Message

Jason Merrill Sept. 13, 2013, 7:08 p.m. UTC
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.
diff mbox

Patch

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));
+  }
+};