llvm-project/clang-tools-extra
Paul Hoad 68f5e5456f [clang-tidy] add OverrideMacro to modernize-use-override check
Summary:
The usefulness of **modernize-use-override** can be reduced if you have to live in an environment where you support multiple compilers, some of which sadly are not yet fully C++11 compliant

some codebases have to use override as a macro OVERRIDE e.g.

```
// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
```

This allows code to be compiled with C++11 compliant compilers and get warnings and errors that clang, MSVC,gcc can give, while still allowing other legacy pre C++11 compilers to compile the code. This can be an important step towards modernizing C++ code whilst living in a legacy codebase.

When it comes to clang tidy, the use of the **modernize-use-override** is one of the most useful checks, but the messages reported are inaccurate for that codebase if the standard approach is to use the macros OVERRIDE and/or FINAL.

When combined with fix-its that introduce the C++11 override keyword, they become fatal, resulting in the modernize-use-override check being turned off to prevent the introduction of such errors.

This revision, allows the possibility for the replacement **override **to be a macro instead, Allowing the clang-tidy check to be run on  both pre and post C++11 code, and allowing fix-its to be applied.

Reviewers: alexfh, JonasToth, hokein, Eugene.Zelenko, aaron.ballman

Reviewed By: alexfh, JonasToth

Subscribers: lewmpk, malcolm.parsons, jdoerfert, xazax.hun, cfe-commits, llvm-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D57087

llvm-svn: 355132
2019-02-28 20:00:48 +00:00
..
change-namespace Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
clang-apply-replacements Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
clang-doc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
clang-move Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
clang-query Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
clang-reorder-fields Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
clang-tidy [clang-tidy] add OverrideMacro to modernize-use-override check 2019-02-28 20:00:48 +00:00
clang-tidy-vs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
clangd Added missing license headers 2019-02-28 14:01:11 +00:00
docs [clang-tidy] add OverrideMacro to modernize-use-override check 2019-02-28 20:00:48 +00:00
include-fixer Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
modularize Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
pp-trace Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
test [clang-tidy] add OverrideMacro to modernize-use-override check 2019-02-28 20:00:48 +00:00
tool-template Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
unittests [clangd] Improve global code completion when scope specifier is unresolved. 2019-02-27 11:42:37 +00:00
.arcconfig [clang-tools-extra] Set up .arcconfig to point to new Diffusion CTE repository 2017-11-27 15:58:25 +00:00
.gitignore
CMakeLists.txt [clangd] XPC transport layer 2019-01-16 00:24:22 +00:00
CODE_OWNERS.TXT Remove myself as owner of clang-query. 2018-11-15 22:02:10 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
README.txt

README.txt

//===----------------------------------------------------------------------===//
// Clang Tools repository
//===----------------------------------------------------------------------===//

Welcome to the repository of extra Clang Tools.  This repository holds tools
that are developed as part of the LLVM compiler infrastructure project and the
Clang frontend.  These tools are kept in a separate "extra" repository to
allow lighter weight checkouts of the core Clang codebase.

This repository is only intended to be checked out inside of a full LLVM+Clang
tree, and in the 'tools/extra' subdirectory of the Clang checkout.

All discussion regarding Clang, Clang-based tools, and code in this repository
should be held using the standard Clang mailing lists:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

Code review for this tree should take place on the standard Clang patch and
commit lists:
  http://lists.llvm.org/mailman/listinfo/cfe-commits

If you find a bug in these tools, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/