FIX: Same Name for Function and Class Causes C2079 (167356)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q167356 SYMPTOMS
If a single name refers to both a class name and a function name, errors
similar to the following may be incorrectly generated:
error C2079: 'g1' uses undefined struct 'g'
error C2875: using-declaration causes a multiple declaration of 'A::x'
error C2513: 'struct B::x' : decl-specifier is missing a declarator
before '='
RESOLUTION
Replace the using declaration with a using directive. For example, in the
following code replace the using declarations:
using B::f
using B::g
using B::x
with one:
using namespace B;
Please see the MORE INFORMATION section for a sample that demonstrates the
workaround.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was corrected in Microsoft Visual C++ version 6.0.
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | kbBug kbfix kbVC600fix KB167356 |
---|
|