Patch for bug 7256

Hello!
This simple update adds the expected name of the destructor to
the diagnostic when the user-provided name is incorrect (bug 7256:
http://llvm.org/bugs/show_bug.cgi?id=7256).

This is only my second patch. Comments are appreciated!

Ryan Gerleve

patch_clang7256.patch (2.28 KB)

Hi Ryan,

Hello!
This simple update adds the expected name of the destructor to
the diagnostic when the user-provided name is incorrect (bug 7256:
http://llvm.org/bugs/show_bug.cgi?id=7256).

This is only my second patch. Comments are appreciated!

It's a great start! Just one technical comment:

+ if(DC->getDeclKind() == Decl::CXXRecord) {
+ CXXRecordDecl* CXXRD(static_cast<CXXRecordDecl*>(DC));

This will fail for class template full and partial specializations, whose DeclKind refers to a subclass of CXXRecordDecl. It would be better to combine these two into

  if (CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(DC)) {

Also, it's generally better to send patches to cfe-commits. cfe-dev is mainly for discussion.

Finally, could you include a test case for Clang's test suite as part of your patch? Extending/updating existing checks would be fine.

  - Doug