Bug in Visual C++ 7.1 ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Owen Brydon

    Bug in Visual C++ 7.1 ?

    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::n pos) {}
    };

    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<c har,std::char_t raits<char>,std ::allocator<cha r> >' : 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
  • Carl Daniel [VC++ MVP]

    #2
    Re: Bug in Visual C++ 7.1 ?

    Owen Brydon wrote:[color=blue]
    > 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[/color]

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

    -cd


    Comment

    • Owen Funkhouser

      #3
      Re: Bug in Visual C++ 7.1 ?

      "Carl Daniel [VC++ MVP]" wrote:[color=blue]
      >
      > Owen Brydon wrote:[color=green]
      > > 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[/color]
      >
      > That'a confirmed bug in VC7.1. It should be fixed in a future version.[/color]

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

      Comment

      Working...