aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-08-13 16:36:26 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-08-13 16:36:26 +0000
commit22eadedb9d1c48bf20b21d2f71c7e5815317a0cb (patch)
tree918dfcbcce0be450af8791c23f979284209cbe84 /gcc
parentb2659518d10f5943c3d90ecbc5263e0288766c43 (diff)
downloadgcc-22eadedb9d1c48bf20b21d2f71c7e5815317a0cb.zip
gcc-22eadedb9d1c48bf20b21d2f71c7e5815317a0cb.tar.gz
gcc-22eadedb9d1c48bf20b21d2f71c7e5815317a0cb.tar.bz2
decl.c (pushdecl_class_level): Honor requests to bind names to OVERLOADs.
* decl.c (pushdecl_class_level): Honor requests to bind names to OVERLOADs. From-SVN: r56258
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c17
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/template/inherit3.C12
4 files changed, 30 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 976fb10..0ab00f6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-13 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (pushdecl_class_level): Honor requests to bind names to
+ OVERLOADs.
+
2002-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* decl2.c (build_call_from_tree): Fix uninitialized variable.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 874baf9..bb0abbd 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4259,13 +4259,13 @@ void
pushdecl_class_level (x)
tree x;
{
- /* Don't use DECL_ASSEMBLER_NAME here! Everything that looks in class
- scope looks for the pre-mangled name. */
- register tree name;
+ tree name;
+ /* Get the name of X. */
if (TREE_CODE (x) == OVERLOAD)
- x = OVL_CURRENT (x);
- name = DECL_NAME (x);
+ name = DECL_NAME (get_first_fn (x));
+ else
+ name = DECL_NAME (x);
if (name)
{
@@ -4275,11 +4275,12 @@ pushdecl_class_level (x)
}
else if (ANON_AGGR_TYPE_P (TREE_TYPE (x)))
{
+ /* If X is an anonymous aggregate, all of its members are
+ treated as if they were members of the class containing the
+ aggregate, for naming purposes. */
tree f;
- for (f = TYPE_FIELDS (TREE_TYPE (x));
- f;
- f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (TREE_TYPE (x)); f; f = TREE_CHAIN (f))
pushdecl_class_level (f);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 267062e..a6d3d69 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2002-08-13 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/template/inherit3: New test.
+
2002-08-10 Nathan Sidwell <nathan@codesourcery.com>
* gcc.dg/bitfld-4.c: Add blank options.
diff --git a/gcc/testsuite/g++.dg/template/inherit3.C b/gcc/testsuite/g++.dg/template/inherit3.C
new file mode 100644
index 0000000..97b9e5b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/inherit3.C
@@ -0,0 +1,12 @@
+template <typename T>
+struct set {
+ void insert (const T&);
+ template <class X>
+ void insert (X, X);
+};
+
+struct C : public set<int> {
+ void f (const int i) {
+ insert (i);
+ }
+};