Microsoft KB Archive/167351

= FIX: Using Declaration Causes C2327 =

Article ID: 167351

Article Last Modified on 12/2/2003

-

APPLIES TO


 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q167351



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 that this is a bug in the Microsoft products that are listed at the beginning of this article.

This problem was corrected in Microsoft Visual C++ .NET.



Sample Code
// Sample Code that causes the error.

template  struct A { int x;  T1 y;   int T2; };

template  struct B : A { using A::T2; };

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

template  struct A { int x;  T1 y;   int T2; };

template  struct B : A { using A::T2; };

Keywords: kbbug kbfix kbnoupdate kbcode KB167351

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.