[cfe-dev] CXXConstructorDecl::isImplicitlyDefined vs. CXXMethodDecl::isDefaulted

Richard Smith richard at metafoo.co.uk
Tue Aug 6 14:30:25 PDT 2013


On Tue, Aug 6, 2013 at 9:15 AM, Jordan Rose <jordan_rose at apple.com> wrote:

> Hi, Richard. Is there any reason not to unify the "implicitly defined"
> bits on CXXConstructorDecl and CXXDestructorDecl with the "IsDefaulted" bit
> already in CXXMethodDecl (actually in FunctionDecl)? It seems like an easy
> simplification that collapses two checks into one in many places.
>

That seems like a great idea to me.

(I'm guessing that the bits for constructors and destructors predated the
> generic notion of defaulted, even with implicit special member functions.)
>

Yes, I think so. I'm not sure how the bit on ctors and dtors was ever
sufficient; the notion of "implicitly defined" also existed for copy
assignment operators in C++98.

We also seem to forget to set the ImplicitlyDefined flag on an implicit
default constructor. Huh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130806/54a9c560/attachment.html>


More information about the cfe-dev mailing list