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
This commit is contained in:
Mark Mitchell 2004-09-27 14:46:55 +00:00 committed by Mark Mitchell
parent c81f61b250
commit d19e85e886
4 changed files with 20 additions and 1 deletions

View 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

View 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);

View 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

View File

@ -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; }
};