OSDN Git Service

Fix PR c++/48656
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Apr 2011 18:08:43 +0000 (18:08 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Apr 2011 18:08:43 +0000 (18:08 +0000)
gcc/cp/

* semantics.c (finish_call_expr): Don't forget BASELINK nodes when
considering call expressions involving a member function.

gcc/testsuite/

* gcc/testsuite/g++.dg/template/inherit7.C: New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173123 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/inherit7.C [new file with mode: 0644]

index 163bee3..6b6d81b 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-28  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/48656
+       * semantics.c (finish_call_expr): Don't forget BASELINK nodes when
+       considering call expressions involving a member function.
+
 2011-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/48530
index c636412..722e57f 100644 (file)
@@ -2039,7 +2039,8 @@ finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
             is not included in *ARGS even though it is considered to
             be part of the list of arguments.  Note that this is
             related to CWG issues 515 and 1005.  */
-         || ((TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
+         || (((TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
+              || BASELINK_P (fn))
              && current_class_ref
              && type_dependent_expression_p (current_class_ref)))
        {
index 7f3804b..b0d5e1c 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-28  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/48656
+       * g++.dg/template/inherit7.C: New test case.
+
 2011-04-28  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/40052
diff --git a/gcc/testsuite/g++.dg/template/inherit7.C b/gcc/testsuite/g++.dg/template/inherit7.C
new file mode 100644 (file)
index 0000000..67afbca
--- /dev/null
@@ -0,0 +1,21 @@
+// Origin: PR c++/48656
+// { dg-options "-std=c++0x" }
+// { dg-do compile }
+
+struct A {
+ int f();
+ int f(int);
+};
+
+template <typename> struct B : A
+{
+};
+
+template <typename T> struct C : B<T>
+{
+    void
+    g()
+    {
+        A::f();
+    }
+};