aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/pt.c8
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/template/friend17.C12
5 files changed, 25 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7c26348..9b0eaf1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2003-03-20 Mark Mitchell <mark@codesourcery.com>
+
+ * cp/decl2.c (arg_assoc_class): Correct check for namespace-scope
+ friends.
+ * cp/pt.c (instantiate_class_template): Fix formatting.
+
2003-03-14 Matt Austern <austern@apple.com>
* cp-tree.h (unemitted_tinfo_decls): Declaration of a new varray.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 1ba80d7..751d0f6 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3963,7 +3963,7 @@ arg_assoc_class (struct arg_lookup *k, tree type)
friends = TREE_CHAIN (friends))
/* Only interested in global functions with potentially hidden
(i.e. unqualified) declarations. */
- if (decl_namespace (TREE_VALUE (friends)) == context)
+ if (CP_DECL_CONTEXT (TREE_VALUE (friends)) == context)
if (add_function (k, TREE_VALUE (friends)))
return true;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 87430b6..8523c96 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5548,12 +5548,8 @@ instantiate_class_template (type)
--processing_template_decl;
}
else
- {
- /* Build new DECL_FRIENDLIST. */
-
- add_friend (type,
- tsubst_friend_function (t, args));
- }
+ /* Build new DECL_FRIENDLIST. */
+ add_friend (type, tsubst_friend_function (t, args));
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 496d9cb..a76454b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2003-03-20 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/template/friend17.C: New test.
+
2003-03-21 Alan Modra <amodra@bigpond.net.au>
* gcc.c-torture/compile/20030320-1.c: New.
diff --git a/gcc/testsuite/g++.dg/template/friend17.C b/gcc/testsuite/g++.dg/template/friend17.C
new file mode 100644
index 0000000..50d6024
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend17.C
@@ -0,0 +1,12 @@
+template <class T>
+struct X {
+ template <class U> void operator+=(U);
+
+ template <class V>
+ template <class U>
+ friend void X<V>::operator+=(U);
+};
+
+int main() {
+ X<int>() += 1.0;
+}