Velocity Reviews

Velocity Reviews (
-   C++ (
-   -   possibly ambiguous wording in [namespace.udir]p6 (

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-

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.