1
#include<iostream>

struct Foo
{

};

void func(Foo& f)
{
    std::cout << "foo" ;
}

int main()
{ 
    func(Foo());//ok compile
    std::cin.ignore();
    return 1;
}

the standard doesn't say this king of thing is not legal ? Is it a bug ?

Guillaume Paris
  • 10,303
  • 14
  • 70
  • 145
  • This is a microsoft extension. Extensions can be disabled by specifying the `/Za` compiler switch. – hmjd Apr 15 '13 at 07:54

1 Answers1

0

It shouldn't be legal. But some older version of Visual C++ (for instance VC6) allow it, afaik.

Andrea Bergia
  • 5,502
  • 1
  • 23
  • 38