re PR c++/17585 (usage of unqualified name of static member from within class not...
authorMark Mitchell <mark@codesourcery.com>
Mon, 27 Sep 2004 14:46:55 +0000 (14:46 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 27 Sep 2004 14:46:55 +0000 (14:46 +0000)
PR c++/17585
* semantics.c (finish_id_expression): Do not add "this->" to
static member functions.

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

From-SVN: r88174

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

index a18a1fb4730d165d2e94fc663cee3ebd3c734be2..34faa4789c5a390e14a5e654cd22499e0fc66c5f 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 53c4cc37f0252ff451d3576cd74f3e41252dfc6f..d966f284c13b157317eaeb5e75d12f070de79bd4 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 a2242d6185868c57ae0cd9a382fec8a0edf69b33..36f51a14b95e50e7cdb0ca7c6dd1406bba681f4a 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; }
+};