This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9726: namespace typedef hides global
- From: joerg dot richter at pdv-fs dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 17 Feb 2003 16:01:55 -0000
- Subject: c++/9726: namespace typedef hides global
- Reply-to: joerg dot richter at pdv-fs dot de
>Number: 9726
>Category: c++
>Synopsis: namespace typedef hides global
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 17 16:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: joerg.richter@pdv-fs.de
>Release: gcc3.2.1
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
compile following code and you will get the error at "foo a;" in main.
-----------------
class foo
{};
namespace bar
{
typedef ::foo foo;
}
using namespace bar;
int main()
{
foo a; // `foo' undeclared (first use this function)
}
>How-To-Repeat:
>Fix:
replacing the "typedef" with an "using" solves the problem
>Release-Note:
>Audit-Trail:
>Unformatted: