0

Ive just tested the following code against vc++ 2015, g++ 4.8.4 and clang 3.4:

    #include <iostream>

    using namespace std;

    class X { };

    void f( /* const */ X &x )
    {
        cout << "void f( const X &x )" << endl;
    }

    int main()
    {
        f( X() );
        return 0;
    }

As far as I know, f( X() ) should be only ok, if f receives a const-reference. g++ and clang don't compile the code. So this seems to be a VC++-bug?

Bonita Montero
  • 2,817
  • 9
  • 22

0 Answers0