aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-10-14 21:09:25 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-10-14 21:09:25 +0000
commit77631fa7edc6a2b6c4177c0f7a3b1eb454e372c3 (patch)
tree7142d32b87fe2af1def71461c8e942143c3586f4 /gcc
parentf5204e6cb8ccfb786d254836ca4c06d3787b6c59 (diff)
downloadgcc-77631fa7edc6a2b6c4177c0f7a3b1eb454e372c3.zip
gcc-77631fa7edc6a2b6c4177c0f7a3b1eb454e372c3.tar.gz
gcc-77631fa7edc6a2b6c4177c0f7a3b1eb454e372c3.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/lex.c4
-rw-r--r--gcc/cp/parse.y2
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/parse/friend1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C2
6 files changed, 26 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5704c90..e5c7356 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 2342c23..bab2988 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -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)
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 104c4a7..78cf991 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -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;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 76df36f..5b1374c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+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.
diff --git a/gcc/testsuite/g++.dg/parse/friend1.C b/gcc/testsuite/g++.dg/parse/friend1.C
new file mode 100644
index 0000000..f19dc9c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/friend1.C
@@ -0,0 +1,9 @@
+namespace N {
+ template <typename T>
+ static void f ();
+
+ struct S {
+ friend void N::f<int> ();
+ static void f (int);
+ };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C
index fbebe3a..6185d3d 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C
@@ -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