This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Namespaces - Wrong errors
- To: gcc-bugs <gcc-bugs at gcc dot gnu dot org>
- Subject: Namespaces - Wrong errors
- From: Philippe Bouchard <philippeb at corel dot com>
- Date: Fri, 20 Oct 2000 12:05:54 +0000
Version:
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
Source:
#include <iostream>
struct A
{
A() { cout << __PRETTY_FUNCTION__ << endl; }
};
namespace UI
{
struct A
{
A() { cout << __PRETTY_FUNCTION__ << endl; }
};
}
int main(...)
{
using namespace UI;
A a = A();
}
Reports:
namespaces.cpp: In function `int main(...)':
namespaces.cpp:20: `A' undeclared (first use this function)
namespaces.cpp:20: (Each undeclared identifier is reported only once
namespaces.cpp:20: for each function it appears in.)
namespaces.cpp:20: parse error before `='
Shouldn't the compiler reports ambiguity instead of "A undeclared"?
begin:vcard
n:Bouchard;Philippe
x-mozilla-html:FALSE
org:Corel Linux
adr:;;;;;;
version:2.1
email;internet:philippeb@corel.com
title:Software Engineer
x-mozilla-cpt:;0
fn:Philippe Bouchard
end:vcard