summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/modernize-use-override.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ClangTidy] Separate tests for infrastructure and checkersDmitri Gribenko2019-10-111-318/+0
| | | | | | | | | | | | | | | | | | | | Summary: This change moves tests for checkers and infrastructure into separate directories, making it easier to find infrastructure tests. Tests for checkers are already easy to find because they are named after the checker. Tests for infrastructure were difficult to find because they were outnumbered by tests for checkers. Now they are in a separate directory. Reviewers: jfb, jdoerfert, lebedev.ri Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68807 llvm-svn: 374540
* Run ClangTidy tests in all C++ language modesDmitri Gribenko2019-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: I inspected every test and did one of the following: - changed the test to run in all language modes, - added a comment explaining why the test is only applicable in a certain mode, - limited the test to language modes where it passes and added a FIXME to fix the checker or the test. Reviewers: alexfh, lebedev.ri Subscribers: nemanjai, kbarton, arphaman, jdoerfert, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62125 llvm-svn: 361131
* [clang-tidy] Fix modernize-use-override incorrect replacementAlexander Kornienko2017-07-071-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For the following code: `modernize-use-override` generates a replacement with incorrect location. ``` struct IntPair { int first, second; }; struct A { virtual void il(IntPair); }; struct B : A { void il(IntPair p = {1, (2 + 3)}) {}; // Generated Fixit: void il(IntPair p = override {1, (2 + 3)}) {}; // Should be: void il(IntPair p = {1, (2 + 3)}) override {}; }; ``` This fixes that and adds a unit test. Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Patch by Victor Gao! Differential Revision: https://reviews.llvm.org/D35078 llvm-svn: 307379
* [clang-tidy] Attempt to fix the test where exceptions are disabled by default.Alexander Kornienko2017-03-011-1/+1
| | | | llvm-svn: 296627
* [clang-tidy] Fix handling of methods with try-statement as a body in ↵Alexander Kornienko2017-03-011-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | modernize-use-override Summary: Fix generated by modernize-use-override caused syntax error when method used try-statement as a body. `override` keyword was inserted after last declaration token which happened to be a `try` keyword. This fixes PR27119. Reviewers: ehsan, djasper, alexfh Reviewed By: alexfh Subscribers: JDevlieghere, cfe-commits Tags: #clang-tools-extra Patch by Paweł Żukowski! Differential Revision: https://reviews.llvm.org/D30002 llvm-svn: 296598
* [clang-tidy] fix a couple of modernize-use-override bugsAlexander Kornienko2016-04-041-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for __declspec attributes and const=0 without space This patch is to address 2 problems I found with Clang-tidy:modernize-use-override. 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. The override is placed before the attribute which doesn’t work well with declspec as this attribute can be inherited or placed before the method identifier. Orig: class __declspec(dllexport) X : public Y { void p(); }; Problem: class override __declspec(dllexport) class X : public Y { void p(); }; Fixed: class __declspec(dllexport) class X : public Y { void p() override; }; Patch by Robert Bolter! Differential Revision: http://reviews.llvm.org/D18396 llvm-svn: 265298
* Add extra tests for handling throw() and noexcept() specifiers.Aaron Ballman2016-01-121-0/+11
| | | | | | Patch by Adrian Zgorzałek llvm-svn: 257522
* Add %check_clang_tidy and %clang_tidy_diff.Manuel Klimek2015-10-221-1/+1
| | | | | | | | | | With this, site specific lit configs can inject parameters into the test scripts if they need site specific parameters. Next up: enable check_clang_tidy to take a resource dir to enable non-standard locations for builtin includes. llvm-svn: 251010
* [clang-tidy] Move misc-use-override and readability-shrink-to-fit to ↵Alexander Kornienko2015-08-311-0/+274
"modernize/" These checks are focusing on migrating the code from C++98/03 to C++11, so they belong to the modernize module. llvm-svn: 246437
OpenPOWER on IntegriCloud