llvm-project/clang-tools-extra/clang-tidy
Alexander Kornienko 91dafe09b0 [clang-tidy] Fix modernize-use-override incorrect replacement
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
2017-07-07 10:15:24 +00:00
..
android [clang-tidy] Rename android-file-open-flag and fix a bug 2017-06-29 19:13:29 +00:00
boost [clang-tidy] boost-use-to-string arg expr location bugfix 2016-06-28 08:16:20 +00:00
cert [clang-tidy] When" -fno-exceptions is used", this warning is better to be suppressed. 2017-06-07 17:41:59 +00:00
cppcoreguidelines [clang-tidy] Resolve cppcoreguidelines-pro-type-member-init false positive 2017-07-03 16:46:46 +00:00
google Make google-build-using-namespace skip std::.*literals 2017-05-15 17:37:48 +00:00
hicpp [clang-tidy] fix for linker errors in hicpp checks 2017-03-30 12:31:02 +00:00
llvm [clang-tidy] TwineLocalCheck: add param # checking 2017-05-14 04:14:59 +00:00
misc [clang-tidy] Enable inline variable definitions in headers 2017-06-28 12:47:35 +00:00
modernize [clang-tidy] Fix modernize-use-override incorrect replacement 2017-07-07 10:15:24 +00:00
mpi modernize-use-auto NFC fixes 2016-12-14 15:29:23 +00:00
performance [clang-tidy] Use getLocalOrGlobal for the StrictMode option 2017-05-29 13:59:27 +00:00
plugin [clang-tidy][Part1] Add a new module Android and three new checks. 2017-06-23 21:37:29 +00:00
readability [clang-tidy] readability-function-size: fix nesting level calculation 2017-06-16 13:07:47 +00:00
tool [clang-tidy][Part1] Add a new module Android and three new checks. 2017-06-23 21:37:29 +00:00
utils Extend readability-container-size-empty to add comparisons to empty-state objects. 2017-04-24 14:57:09 +00:00
CMakeLists.txt [clang-tidy][Part1] Add a new module Android and three new checks. 2017-06-23 21:37:29 +00:00
ClangTidy.cpp Change getChecksFilter() interface to hide implementation details. 2017-05-17 14:39:47 +00:00
ClangTidy.h [clang-tidy] Add FormatStyle configuration option. 2017-04-06 13:41:29 +00:00
ClangTidyDiagnosticConsumer.cpp [NFC] Update to account for DiagnosticRenderer use of FullSourceLoc 2017-06-27 10:04:04 +00:00
ClangTidyDiagnosticConsumer.h [clang-tidy] Optimize GlobList::contains 2017-05-18 01:13:51 +00:00
ClangTidyModule.cpp Change getChecksFilter() interface to hide implementation details. 2017-05-17 14:39:47 +00:00
ClangTidyModule.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
ClangTidyModuleRegistry.h Reapply r276973 "Adjust Registry interface to not require plugins to export a registry" 2016-08-05 11:01:08 +00:00
ClangTidyOptions.cpp Fix ODR violations due to abuse of LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR 2017-06-30 20:57:16 +00:00
ClangTidyOptions.h [clang-tidy] Add FormatStyle configuration option. 2017-04-06 13:41:29 +00:00
add_new_check.py [clang-tidy] Rename modernize-use-default to modernize-use-equals-default 2016-12-01 17:24:42 +00:00
rename_check.py [clang-tidy] Improve rename_check.py. 2016-11-08 11:43:50 +00:00