Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   possibly ambiguous wording in [namespace.udir]p6 (http://www.velocityreviews.com/forums/t953554-possibly-ambiguous-wording-in-namespace-udir-p6.html)

Ivan Sorokin 10-18-2012 04:07 PM

possibly ambiguous wording in [namespace.udir]p6
 
Is the following code a correct C++ program?

namespace a
{
struct x
{};
}

namespace b
{
namespace d = a;
}

namespace c
{
namespace d = a;
}

using namespace b;
using namespace c;

d::x x;

Is "d" in "d::x" ambiguous or not? MSVC accepts this code, while
clang, gcc and EDG reject it.

[namespace.udir]p3: If name lookup finds a declaration for a name in
two different namespaces, and the declarations do not declare the same
entity and do not declare functions, the use of the name is ill-
formed.

Does namespace-alias declares new entity or refers to existing?

According to [namespace.alias]p3 redefinition of namespace-alias in
the same declarative region is ok as long as it refers to the same
namespace, but [namespace.alias]p3 doesn't say anything about
interaction with using-directives.


All times are GMT. The time now is 10:53 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.