-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
| Bugzilla Link | 3990 |
| Resolution | FIXED |
| Resolved on | Mar 06, 2010 14:00 |
| Version | unspecified |
| OS | All |
| CC | @DougGregor |
Extended Description
This code:
namespace N {
struct Wibble {
};
typedef Wibble foo;
}
using namespace N;
foo::bar x;
void f() {
foo::bar = 4;
}
Gives very poor diagnostics:
foo.cpp:9:6: error: unknown type name 'bar'
foo::bar x;
foo.cpp:12:6: error: no member named 'bar'
foo::bar = 4;
~~~~~^
2 diagnostics generated.
For the first error, we should say something like:
error: unknown type name 'foo::bar'
in the second case, perhaps
error: no member named 'bar' in 'foo' (aka 'struct N::Wibble')
G++ does something like this:
foo.cpp:9: error: ‘bar’ in class ‘N::foo’ does not name a type
foo.cpp: In function ‘void f()’:
foo.cpp:12: error: ‘bar’ is not a member of ‘N::foo’