From 8ffc2e370dfde7443cb3aa24d46359f5f9c60466 Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Fri, 14 Nov 2003 21:41:04 +0100 Subject: [PATCH] re PR c++/2294 (using declaration confusion) PR c++/2294 * g++.dg/lookup/using9.c: New test. From-SVN: r73621 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/lookup/using9.C | 30 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/g++.dg/lookup/using9.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3e9f9fad01fd..a8c23065e4e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-11-14 Giovanni Bajo + + PR c++/2294 + * g++.dg/lookup/using9.c: New test. + 2003-11-14 Mark Mitchell PR c++/12762 diff --git a/gcc/testsuite/g++.dg/lookup/using9.C b/gcc/testsuite/g++.dg/lookup/using9.C new file mode 100644 index 000000000000..c62267519b0b --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using9.C @@ -0,0 +1,30 @@ +// { dg-do compile } +// Origin: C++ Standard Draft (7.3.3/12) +// PR c++/2294: using declarations should not conflict, but only cause +// an ambiguous overload set to be created. + +namespace B { + void f(int); // { dg-error "note" } + void f(double); // { dg-error "note" } +} + +namespace C { + void f(int); // { dg-error "note" } + void f(double); // { dg-error "note" } + void f(char); // { dg-error "note" } +} + +void h() +{ + using B::f; + using C::f; + f('h'); + f(1); // { dg-error "ambiguous" } + void f(int); // { dg-error "previous using declaration" } +} + +void m() +{ + void f(int); + using B::f; // { dg-error "already declared" } +}