"Marcin Kalicinski" <ka****@poczta.onet.pl> wrote in message
news:c8**********@korweta.task.gda.pl...
Hi,
Should the below code compile according to C++ standard?
namespace N { struct S{ }; }
void S() { }
using N::S;
IMO, no.
3.4.3.2/5 reads -
<quote>
During the lookup of a qualified namespace member name, if the lookup finds more
than one declaration of the member, and if one declaration introduces a class
name or enumeration name and the other declarations either introduce the same
object, the same enumerator or a set of functions, the non-type name hides the
class or enumeration name if and only if the declarations are from the same
namespace; otherwise (the declarations are from different namespaces), the
program is ill-formed
</quote>
void S() belongs to global namespace while struct S belongs to N. Hence I see
the program as illegal.
-Sharad