Victor Bazarov said:
Answering your original question, yes, it's valid. 'X' is a synonym
for 'int' in 'foo_t' declarative region. You may bring that name
into any other declarative region, where foo_t::X is accessible.
I guess since your compiler accepts it, you don't have a problem,
but may I ask, what prompted your question in the first place?
Victor
Well, my compiler (VC++ 7.1) accepts it, but Comeau (the online test-drive
version) does not...
Comeau (as well as my compiler) will, however, accept this:
typedef foo_t::X X;
You know, looking at the C++ grammar as defined in the Standard, it appears
that, syntactically, a using declaration may indeed be used to access a
class scope. Of course, this jives with your statement that it is valid.
Unless there's a semantic reason this is invalid that we've both missed,
perhaps a minor bug has just been found in Comeau??????
I'd love to hear your further thoughts as well as any other thoughts anyone
has...