Bug in Visual C++ 7.1 ?

O

Owen Brydon

Hello,

Can anyone confirm if the following is a bug in MSVC++7.1, or an error
in the code?. This compiles fine under g++ and MSVC++7.0

#include <string>

using std::string;

class hello
{
public:
hello() {}
~hello(){}
void fn(string::size_type Index=string::npos) {}
};

int main()
{
hello a;
return 0;
}

If I take fn() out of the class and put it at global scope, it
compiles fine. Otherwise, I get the following errors:

main.cpp(10) : error C2653:
'basic_string<char,std::char_traits<char>,std::allocator<char> >' : is
not a class or namespace name
main.cpp(10) : error C2065: 'npos' : undeclared identifier

Like I say, this was fine under the previous version of Visual C++, so
have I got a subtle error, or have MS broken their compiler?

Owen Brydon
 
C

Carl Daniel [VC++ MVP]

Owen said:
Hello,

Can anyone confirm if the following is a bug in MSVC++7.1, or an error
in the code?. This compiles fine under g++ and MSVC++7.0

That'a confirmed bug in VC7.1. It should be fixed in a future version.

-cd
 
O

Owen Funkhouser

Carl Daniel said:
That'a confirmed bug in VC7.1. It should be fixed in a future version.

So that we can track this, is there knowledge base number associated with this bug?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top