This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12272] using declaration shadows namespace


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12272



------- Additional Comments From gdr at integrable-solutions dot net  2003-09-15 01:39 -------
Subject: Re:  using declaration shadows namespace

"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Here's a cut-down testcase: 
| ---------------------------------------------- 
| namespace NS1 { 
|   namespace NS2 { 
|   }; 
| } 
| namespace NS2 { 
|   class X; 
| } 
| using namespace NS1; 
|  
| typedef NS2::X Y; 
          ^^^

"NS2" is ambiguous:  NS1::NS2 or ::NS2? 


| -------------------------------- 
|  
| It fails like so with 3.3: 
| tmp/g> ~/bin/gcc-3.3/bin/c++ -c x.cc 
| x.cc:10: error: syntax error before `::' token 

bogus diagnostic message.

| I think it should pass.

No, it should not.  But the diagnostic message is close to useless.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]