VC5.0 does work when using namespaces with using directive 
Author Message
 VC5.0 does work when using namespaces with using directive

Hi all,

I've found a strange behavior of the VC++ compiler that seems to be a bug:
I use an own namespace to write my code and make multiple re-opens of the
namespace. If I use  3 times the same using-directive to get access to a
class located in another namespace (for example std::string), then I get
the following error:
error C2501: 'tab' : missing decl-specifiers

Here below is a simple sample of the code that does not compile:

namespace a
{
  class str
  {
  };

Quote:
}

namespace X
{
  using namespace a;
  str s1;

Quote:
}

namespace X
{
  using namespace a;
  str s2;

Quote:
}

namespace X
{
  using namespace a;
  str s3;  // <- error occurs here

Quote:
}

Note that the behavior of the compiler may vary if several namespaces (say
a namespace b with a class tab) are used and the order of insertions of the
using-directive differs.
So this bug seems to be a tricky one and merits to be fixed to help all
people working with namespaces.

Kind regards,
Sam

------------------------------------------------------------------
Samuel Rouiller
Ascom Networked Service Automation
Morgenstrasse 129, 3018 Bern

Phone: +41 31 999 27 98
Fax: +41 31 999 18 35
------------------------------------------------------------------



Sun, 05 Mar 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Development environment hanging when using #import directive with type-lib id'si

2. warning generated for using #ident directive

3. Bug in using directive?

4. Sharing global data using #pragma data_seg directive

5. Using MSVC #import directive with VB ActiveX control

6. Using DLL and stdcall directive

7. Using preprocessor directives: #ifdef, etc.

8. A happy medium between using-directives and explicit qualification

9. Page Directives - Attributes and Namespaces

10. Question about namespace directive

11. Q147740 CWnd work-around doesn't work with control that uses lic file

12. can this be done using C# in .NET?

 

 
Powered by phpBB® Forum Software