aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-03-13 20:54:36 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-03-13 20:54:36 +0000
commit45707d3120b9f91076bf8ab60a60fa094f2eb7b5 (patch)
tree2b41f95c6fb257708d495e55a5b27d63e19beb7c /gcc
parent6d7b8b3509ae39373f39a26d42a1a10398dbebea (diff)
downloadgcc-45707d3120b9f91076bf8ab60a60fa094f2eb7b5.zip
gcc-45707d3120b9f91076bf8ab60a60fa094f2eb7b5.tar.gz
gcc-45707d3120b9f91076bf8ab60a60fa094f2eb7b5.tar.bz2
decl2.c (do_nonmember_using_decl): Correct handling of simultaneous type/non-type bindings.
* decl2.c (do_nonmember_using_decl): Correct handling of simultaneous type/non-type bindings. * g++.dg/parse/namespace9.C: New test. From-SVN: r64323
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/decl2.c7
-rw-r--r--gcc/testsuite/ChangeLog2
-rw-r--r--gcc/testsuite/g++.dg/parse/namespace9.C8
4 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6a679d2..2916688 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2003-03-13 Mark Mitchell <mark@codesourcery.com>
+ * decl2.c (do_nonmember_using_decl): Correct handling of
+ simultaneous type/non-type bindings.
+
* call.c (initialize_reference): Remove bogus assertion.
* decl.c (build_ptrmemfunc_type): Revert change of 2003-03-09.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index b4654c9..fb25127 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -4222,6 +4222,13 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
{
tree tmp, tmp1;
+ if (oldval && !is_overloaded_fn (oldval))
+ {
+ if (!DECL_IMPLICIT_TYPEDEF_P (oldval))
+ error ("`%D' is already declared in this scope", name);
+ oldval = NULL_TREE;
+ }
+
*newval = oldval;
for (tmp = BINDING_VALUE (decls); tmp; tmp = OVL_NEXT (tmp))
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3407e5c..1cf0834 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,7 @@
2003-03-13 Mark Mitchell <mark@codesourcery.com>
+ * g++.dg/parse/namespace9.C: New test.
+
* g++.dg/init/ref5.C: New test.
* g++.dg/parse/ptrmem1.C: Likewise.
diff --git a/gcc/testsuite/g++.dg/parse/namespace9.C b/gcc/testsuite/g++.dg/parse/namespace9.C
new file mode 100644
index 0000000..7ff0267
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/namespace9.C
@@ -0,0 +1,8 @@
+namespace A {
+ void f();
+}
+int g()
+{
+ struct f { };
+ using A::f;
+}