I wanted to add a copy constructor to the class, but forgot to add this type. g ++ 5.4.0 compiled the class successfully.
Here's the minimal program that g ++ 5.4.0 compiles and builds successfully.
struct Foo
{
Foo(const&) {}
Foo() {}
};
int main()
{
Foo f1;
Foo f2 = f1;
}
Why does g ++ not report Foo(const&) {}as an error?
source
share