Commit 77631fa7 by Mark Mitchell Committed by Mark Mitchell

re PR c++/7176 (g++ confused by friend and static member with same name)

	PR c++/7176
	* g++.dg/parse/friend1.C: New test.
	* g++.old-deja/g++.pt/memtemp64.C: Adjust.

	PR c++/7176
	* lex.c (do_identifier): Add another option for the parsing
	parameter.
	* parse.y (do_id): Use it.

From-SVN: r58135
parent f5204e6c
2002-10-14 Mark Mitchell <mark@codesourcery.com>
PR c++/7176
* lex.c (do_identifier): Add another option for the parsing
parameter.
* parse.y (do_id): Use it.
2002-10-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
PRs C++/6803, C++/7721 and C++/7803
......
......@@ -1135,7 +1135,7 @@ do_identifier (token, parsing, args)
tree args;
{
register tree id;
int lexing = (parsing == 1);
int lexing = (parsing == 1 || parsing == 3);
if (! lexing)
id = lookup_name (token, 0);
......@@ -1157,7 +1157,7 @@ do_identifier (token, parsing, args)
/* Remember that this name has been used in the class definition, as per
[class.scope0] */
if (id && parsing)
if (id && parsing && parsing != 3)
maybe_note_name_used_in_class (token, id);
if (id == error_mark_node)
......
......@@ -1516,7 +1516,7 @@ do_id:
do_identifier; we only do that for unqualified
identifiers. */
if (!lastiddecl || !BASELINK_P (lastiddecl))
$$ = do_identifier ($<ttype>-1, 1, NULL_TREE);
$$ = do_identifier ($<ttype>-1, 3, NULL_TREE);
else
$$ = $<ttype>-1;
}
......
2002-10-14 Mark Mitchell <mark@codesourcery.com>
PR c++/7176
* g++.dg/parse/friend1.C: New test.
* g++.old-deja/g++.pt/memtemp64.C: Adjust.
2002-10-14 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/20021014-1.c: New test.
......
namespace N {
template <typename T>
static void f ();
struct S {
friend void N::f<int> ();
static void f (int);
};
}
......@@ -4,7 +4,7 @@ template <class T>
struct S1 {};
template <class T>
void f(T); // ERROR - original declaration.
void f(T);
template <class C>
struct S2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment