diff options
| author | Jonas Toth <jonas.toth@gmail.com> | 2018-01-17 10:27:41 +0000 |
|---|---|---|
| committer | Jonas Toth <jonas.toth@gmail.com> | 2018-01-17 10:27:41 +0000 |
| commit | f22f3489d76698c1843957972576bfbba515572a (patch) | |
| tree | fe38a922e894da63f63213b828e83cab384406b8 /clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt | |
| parent | 0b89c55aeafbb32f6c26693064a73d2b2e5a1d60 (diff) | |
| download | bcm5719-llvm-f22f3489d76698c1843957972576bfbba515572a.tar.gz bcm5719-llvm-f22f3489d76698c1843957972576bfbba515572a.zip | |
[clang-tidy] implement check for goto
The usage of `goto` is discourage in C++ since forever. This check implements
a warning for every `goto`. Even though there are (rare) valid use cases for
`goto`, better high level constructs should be used.
`goto` is used sometimes in C programs to free resources at the end of
functions in the case of errors. This pattern is better implemented with
RAII in C++.
Reviewers: aaron.ballman, alexfh, hokein
Reviewed By: aaron.ballman
Subscribers: lebedev.ri, jbcoe, Eugene.Zelenko, klimek, nemanjai, mgorny, xazax.hun, kbarton, cfe-commits
Differential Revision: https://reviews.llvm.org/D41815
llvm-svn: 322626
Diffstat (limited to 'clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt')
| -rw-r--r-- | clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt b/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt index 70ee599c69e..2ce1a0800de 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS support) add_clang_library(clangTidyCppCoreGuidelinesModule + AvoidGotoCheck.cpp CppCoreGuidelinesTidyModule.cpp InterfacesGlobalInitCheck.cpp NoMallocCheck.cpp |

