CXXConstructorDecl::isImplicitlyDefined vs. CXXMethodDecl::isDefaulted

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.

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

Jordan

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.

Done in r187891. All regression tests pass; hoping the buildbots don’t fall over.

Jordan