[cfe-dev] suppress "no matching constructor for initialization of" errors?

John McCall rjmccall at apple.com
Mon Apr 4 10:05:53 PDT 2011


On Apr 4, 2011, at 6:20 AM, Jack Howarth wrote:
>  I am puzzled by the "no matching constructor for initialization of" errors in clang++.
> My impression was that this additional level of strictness was added for the benefit of
> obj-c++.

I don't know where you got that impression;  we have not increased
the strictness of the C++ type system for the benefit of Objective-C++.
These are not optional errors:  the compiler really cannot (or it is
forbidden to) compile your program without a constructor.  The one
exception is when binding a reference to a temporary, which C++ '03
technically requires a copy constructor for, but which most vendors
choose not to complain about.

It is, of course, always possible that we have a bug in our logic for
whether a constructor matches a set of arguments, but we can't
answer that without knowing what version o the compiler you're
working with and what code you're getting an error about.

John.



More information about the cfe-dev mailing list