Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > possibly ambiguous wording in [namespace.udir]p6

Reply
Thread Tools

possibly ambiguous wording in [namespace.udir]p6

 
 
Ivan Sorokin
Guest
Posts: n/a
 
      10-18-2012
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;

Is "d" in "d:" 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wording suggestion for documentation (Data Model) Jason R. Coombs Python 0 06-13-2008 12:16 AM
Question on Wording Paulo Jorge de O. C. de Matos C Programming 8 05-05-2008 04:10 AM
clinic 2263 - wording ? Which is right ? - Bobb - MCDST 5 12-13-2005 05:14 AM
Accelerated C++: Clarification on the wording of exercises Frankie Montenegro C++ 3 10-14-2005 04:21 PM
Question on wording Kayla Digital Photography 11 07-19-2005 12:48 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57