PR c++/17585
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Sep 2004 14:46:55 +0000 (14:46 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Sep 2004 14:46:55 +0000 (14:46 +0000)
* semantics.c (finish_id_expression): Do not add "this->" to
static member functions.

PR c++/17585
* g++.dg/template/static8.C: New test.

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

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

index a18a1fb..34faa47 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-27  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/17585
+       * semantics.c (finish_id_expression): Do not add "this->" to
+       static member functions.
+
 2004-09-27  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/17681
index 53c4cc3..d966f28 100644 (file)
@@ -2646,7 +2646,7 @@ finish_id_expression (tree id_expression,
            mark_used (first_fn);
 
          if (TREE_CODE (first_fn) == FUNCTION_DECL
-             && DECL_FUNCTION_MEMBER_P (first_fn))
+             && DECL_NONSTATIC_MEMBER_FUNCTION_P (first_fn))
            {
              /* A set of member functions.  */
              decl = maybe_dummy_object (DECL_CONTEXT (first_fn), 0);
index a2242d6..36f51a1 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-27  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/17585
+       * g++.dg/template/static8.C: New test.
+
 2004-09-27  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/17681
diff --git a/gcc/testsuite/g++.dg/template/static8.C b/gcc/testsuite/g++.dg/template/static8.C
new file mode 100644 (file)
index 0000000..f8229fd
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/17585
+
+template <void (*p)(void)> struct S03 {};
+class C03 {
+public:
+  static void f(void) {}
+  void g(void) { S03<&f> s03; }
+};