diff options
| author | Ben Hamilton <benhamilton@google.com> | 2018-05-16 20:07:19 +0000 |
|---|---|---|
| committer | Ben Hamilton <benhamilton@google.com> | 2018-05-16 20:07:19 +0000 |
| commit | 35d3398f8dc64727189c99f123aed1467153864b (patch) | |
| tree | b9550a88fdbeaa0edd766ce187f53437b2d2da70 /clang-tools-extra/clang-tidy/google | |
| parent | f8947da9cee7228850866f1cf40c5452d358e441 (diff) | |
| download | bcm5719-llvm-35d3398f8dc64727189c99f123aed1467153864b.tar.gz bcm5719-llvm-35d3398f8dc64727189c99f123aed1467153864b.zip | |
[clang-tidy/google-readability-casting] Disable check for Objective-C++
Summary:
Previously, `google-readability-casting` was disabled for Objective-C.
The Google Objective-C++ style allows both Objective-C and
C++ style in the same file. Since clang-tidy doesn't have a good
way to allow multiple styles per file, this disables the
check for Objective-C++.
Test Plan: New tests added. Ran tests with:
% make -j16 check-clang-tools
Before diff, confirmed tests failed:
https://reviews.llvm.org/P8081
After diff, confirrmed tests passed.
Reviewers: alexfh, Wizard, hokein, stephanemoore
Reviewed By: alexfh, Wizard, stephanemoore
Subscribers: stephanemoore, cfe-commits, bkramer, klimek
Differential Revision: https://reviews.llvm.org/D46659
llvm-svn: 332516
Diffstat (limited to 'clang-tools-extra/clang-tidy/google')
| -rw-r--r-- | clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp index 80cc475b07a..4c7c164b906 100644 --- a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp @@ -100,7 +100,8 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) { } // The rest of this check is only relevant to C++. - if (!getLangOpts().CPlusPlus) + // We also disable it for Objective-C++. + if (!getLangOpts().CPlusPlus || getLangOpts().ObjC1 || getLangOpts().ObjC2) return; // Ignore code inside extern "C" {} blocks. if (!match(expr(hasAncestor(linkageSpecDecl())), *CastExpr, *Result.Context) |

