diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-09-27 14:46:55 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-09-27 14:46:55 +0000 |
commit | d19e85e8869ee6302b7447267f9f50d1d27ba6cc (patch) | |
tree | a4d0fd6f8e7416e581676a3c79caa9c01566e62f /gcc | |
parent | c81f61b2506d111b638e6aa329f87f78a289e379 (diff) | |
download | gcc-d19e85e8869ee6302b7447267f9f50d1d27ba6cc.zip gcc-d19e85e8869ee6302b7447267f9f50d1d27ba6cc.tar.gz gcc-d19e85e8869ee6302b7447267f9f50d1d27ba6cc.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/static8.C | 8 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a18a1fb..34faa47 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 53c4cc3..d966f28 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 a2242d6..36f51a1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..f8229fd --- /dev/null +++ b/gcc/testsuite/g++.dg/template/static8.C @@ -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; } +}; |