From d19e85e8869ee6302b7447267f9f50d1d27ba6cc Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 27 Sep 2004 14:46:55 +0000 Subject: [PATCH] re PR c++/17585 (usage of unqualified name of static member from within class not allowed) 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 | 6 ++++++ gcc/cp/semantics.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/static8.C | 8 ++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/template/static8.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a18a1fb4730..34faa4789c5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-09-27 Mark Mitchell + + PR c++/17585 + * semantics.c (finish_id_expression): Do not add "this->" to + static member functions. + 2004-09-27 Nathan Sidwell PR c++/17681 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 53c4cc37f02..d966f284c13 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a2242d61858..36f51a14b95 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-09-27 Mark Mitchell + + PR c++/17585 + * g++.dg/template/static8.C: New test. + 2004-09-27 Nathan Sidwell 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 index 00000000000..f8229fd827e --- /dev/null +++ b/gcc/testsuite/g++.dg/template/static8.C @@ -0,0 +1,8 @@ +// PR c++/17585 + +template struct S03 {}; +class C03 { +public: + static void f(void) {} + void g(void) { S03<&f> s03; } +}; -- 2.30.2