BUG: Using Declaration Causes C2327

Last reviewed: June 12, 1997
Article ID: Q167351
The information in this article applies to:
  • Microsoft Visual C++, 32-bit Editions, version 5.0

SYMPTOMS

A using declaration causes the following error:

   error C2327: 'B::A::T2' : member from enclosing class is not a type
                             name, static, or enumerator

CAUSE

The name specified in a using declaration has the same name as an identifier in the template argument list of a templated class.

RESOLUTION

Modify the name in the using declaration or modify the name of the identifier in the template argument list (see sample code below).

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Sample Code

   // Sample Code that causes the error.

   template <class T1> struct A {
   int x;
   T1 y;
   int T2;
   };

   template <class T2> struct B : A<T2> {
   using A<T2>::T2;
   };

   // Sample Code that works around the error by changing the template
   // argument list.

   template <class T1> struct A {
   int x;
   T1 y;
   int T2;
   };

   template <class T3> struct B : A<T3> {
   using A<T3>::T2;
   };
 

	
	


Keywords : CPPIss kbcode kbtool vcbuglist500 kbbuglist
Version : 5.0
Platform : NT WINDOWS
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 12, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.