Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can someone with VC++ 2008 "Orcas" test this?

Can someone with VC++ 2008 "Orcas" test this?

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++visual-studioquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dontknowitall
    wrote on last edited by
    #1

    I need someone with Orcas to test the following code. It compiles just fine under Comeau C++ 4.3.9 in strict mode (Comeau is supposedly the "most Standards-compliant compiler in existence") but fails with an error under VS.NET 2003 (VC++). According to the ANSI Standard (section 10.3.5 in my Draft copy), I can't find any reason for it to fail.

    // This code fails on VS.NET 2003 (VC++) with a error.
    //
    // error C2511: 'MyBase2 *MyDerived::Copy(void)' :
    // overloaded member function not found in 'MyDerived'
    //
    // Removing the 'const' qualifiers fixes the problem.

    class MyBase
    {
    public:
    MyBase() {}
    virtual ~MyBase() {}

    virtual MyBase *Copy() const
    {
    return new MyBase(*this);
    }
    };

    class MyBase2
    {
    public:
    MyBase2() {}
    virtual ~MyBase2() {}

    virtual MyBase2 *Copy() const
    {
    return new MyBase2(*this);
    }
    };

    class MyDerived : public MyBase, public MyBase2
    {
    public:
    MyDerived() {}
    virtual ~MyDerived() {}

    virtual MyDerived *Copy() const
    {
    return new MyDerived(*this);
    }
    };

    int main()
    {
    return 0;
    }

    J M 2 Replies Last reply
    0
    • D dontknowitall

      I need someone with Orcas to test the following code. It compiles just fine under Comeau C++ 4.3.9 in strict mode (Comeau is supposedly the "most Standards-compliant compiler in existence") but fails with an error under VS.NET 2003 (VC++). According to the ANSI Standard (section 10.3.5 in my Draft copy), I can't find any reason for it to fail.

      // This code fails on VS.NET 2003 (VC++) with a error.
      //
      // error C2511: 'MyBase2 *MyDerived::Copy(void)' :
      // overloaded member function not found in 'MyDerived'
      //
      // Removing the 'const' qualifiers fixes the problem.

      class MyBase
      {
      public:
      MyBase() {}
      virtual ~MyBase() {}

      virtual MyBase *Copy() const
      {
      return new MyBase(*this);
      }
      };

      class MyBase2
      {
      public:
      MyBase2() {}
      virtual ~MyBase2() {}

      virtual MyBase2 *Copy() const
      {
      return new MyBase2(*this);
      }
      };

      class MyDerived : public MyBase, public MyBase2
      {
      public:
      MyDerived() {}
      virtual ~MyDerived() {}

      virtual MyDerived *Copy() const
      {
      return new MyDerived(*this);
      }
      };

      int main()
      {
      return 0;
      }

      J Offline
      J Offline
      Jonathan Darka
      wrote on last edited by
      #2

      What error do you get ?


      Jonathan Wilkes Darka[Xanya.net]

      D 1 Reply Last reply
      0
      • J Jonathan Darka

        What error do you get ?


        Jonathan Wilkes Darka[Xanya.net]

        D Offline
        D Offline
        dontknowitall
        wrote on last edited by
        #3

        I don't have Orcas installed and really don't want to risk messing up my main build environment, which is a pretty delicate setup. Dropping a new compiler on the system is the general equivalent of a tactical nuclear warhead. I want to know if the bug is in Orcas (i.e. emits an incorrect error message). Please, just run it through Orcas and post the output.

        1 Reply Last reply
        0
        • D dontknowitall

          I need someone with Orcas to test the following code. It compiles just fine under Comeau C++ 4.3.9 in strict mode (Comeau is supposedly the "most Standards-compliant compiler in existence") but fails with an error under VS.NET 2003 (VC++). According to the ANSI Standard (section 10.3.5 in my Draft copy), I can't find any reason for it to fail.

          // This code fails on VS.NET 2003 (VC++) with a error.
          //
          // error C2511: 'MyBase2 *MyDerived::Copy(void)' :
          // overloaded member function not found in 'MyDerived'
          //
          // Removing the 'const' qualifiers fixes the problem.

          class MyBase
          {
          public:
          MyBase() {}
          virtual ~MyBase() {}

          virtual MyBase *Copy() const
          {
          return new MyBase(*this);
          }
          };

          class MyBase2
          {
          public:
          MyBase2() {}
          virtual ~MyBase2() {}

          virtual MyBase2 *Copy() const
          {
          return new MyBase2(*this);
          }
          };

          class MyDerived : public MyBase, public MyBase2
          {
          public:
          MyDerived() {}
          virtual ~MyDerived() {}

          virtual MyDerived *Copy() const
          {
          return new MyDerived(*this);
          }
          };

          int main()
          {
          return 0;
          }

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          I know you didn't ask, but it works fine in 2005. Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          D 1 Reply Last reply
          0
          • M Mark Salsbery

            I know you didn't ask, but it works fine in 2005. Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            D Offline
            D Offline
            dontknowitall
            wrote on last edited by
            #5

            Thanks. I'll just assume it works fine in VS 2008 as well.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups