Page MenuHomePhabricator

Fix improper microsoft-pure-definition warning on template class
ClosedPublic

Authored by Ilod on Feb 8 2017, 1:39 AM.

Details

Summary

Clang emits a warning when using pure specifier =0 in function definition at class scope, which is a MS-specific construct, when using -fms-extensions.
However, to detect this, it was using FD->isCanonicalDecl() on function declaration, which was also detecting out-of-class definition of member functions of template class.
This fix it by instead of !FD->isOutOfLine() to detect the places where we must emit the warning.
This will fix https://llvm.org/bugs/show_bug.cgi?id=21334

Diff Detail

Repository
rL LLVM

Event Timeline

Ilod created this revision.Feb 8 2017, 1:39 AM

Just wondering if this will be fixed soon. It's kinda annoying.

riccibruno accepted this revision.Apr 21 2019, 5:45 AM

This looks reasonable to me (although I think that the test should be in SemaCXX/ and not in Parser/, but the test for the non-template case is already in Parser/ so ok).

This revision is now accepted and ready to land.Apr 21 2019, 5:45 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2019, 6:12 AM