clang-tidy modernize-use-override

Robert Bolter via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 06:43:29 PDT 2016


Hi,

First time poster here, Please advise...

Can I contribute these patches for clang-tidy modernize-use-override addressing two problems:

1: missing spaces on pure function decls

Orig:
void pure() const=0
Problem:
void pure() constoverride =0
Fixed:
void pure() const override =0

2: This is ms-extension specific, but possibly applies to other attribute types as I see incorrect placement of override for Inherited Attributes and atts located before the method

Orig:
class __declspec(dllexport) X : public Y
  {
void p(); //inherits decl att
  };
Problem:
class override __declspec(dllexport) class X : public Y
  {
  void p();
  };
Fixed:
class __declspec(dllexport) class X : public Y
  {
  void p() override;
  };

I added test/clang-tidy/modernize-use-override-ms.cpp and modified modernize-use-override.cpp to test these fixes.


I've also added a -quiet option to clang-tidy/tool/run-clang-tidy.py  and a progress countdown which I personally find useful :)


Thanks,
Rob.


________________________________

Autodesk Limited
Registered Office: One Discovery Place, Columbus Drive, Farnborough, Hampshire GU14 0NZ
Registered in England and Wales, No. 1839239
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160321/bb084495/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-run-clang-tidy-Adding-a-quiet-option-to-suppress-out.patch
Type: application/octet-stream
Size: 3005 bytes
Desc: 0001-run-clang-tidy-Adding-a-quiet-option-to-suppress-out.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160321/bb084495/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-modernize-use-override-fix-for-const-0-without-space.patch
Type: application/octet-stream
Size: 5002 bytes
Desc: 0001-modernize-use-override-fix-for-const-0-without-space.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160321/bb084495/attachment-0001.obj>


More information about the llvm-commits mailing list