|
Implement the HandleTagDeclDefinition method in our ASTConsumer. Clang
calls this method during parsing on completion of each class definition.
This gives us a chance to modify class definitions.
Teach HandleTagDeclDefinition to add the implicit member declarations.
For each implicit member, ask Clang to try instantiating its definition
to see if a call to the member will actually work. Suppress errors
during this check using a clang::Sema::SFINAETrap and simply mark
the declaration as invalid if there were errors.
Add test cases for:
* implicit members that cannot be used due to access, const data members,
or reference data members.
* a POD array data member since Clang uses special logic when creating
implicit members that copy the data.
* a mutable data member since Clang adds implicit member declarations
itself (via clang::Sema::AddImplicitlyDeclaredMembersToClass),
but we still need to try defining them.
* a class that uses its implicit members so they are already defined.
|