diff options
author | Nathan James <n.james93@hotmail.co.uk> | 2020-02-02 21:26:04 +0000 |
---|---|---|
committer | Hans Wennborg <hans@chromium.org> | 2020-02-10 14:17:54 +0100 |
commit | 84cda4cceabdfec4f130bfafe7bbd050aa65b2ec (patch) | |
tree | 75071bd374756c72c9aea16ef5310db55bc9b8fb /clang-tools-extra/test/clang-tidy | |
parent | 8b8a4834a4b8aaff751c95e458d7a01ceae081a2 (diff) | |
download | bcm5719-llvm-84cda4cceabdfec4f130bfafe7bbd050aa65b2ec.tar.gz bcm5719-llvm-84cda4cceabdfec4f130bfafe7bbd050aa65b2ec.zip |
[clang-tidy] Fix false positive for cppcoreguidelines-init-variables
Summary: Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44746 | False positive for cppcoreguidelines-init-variables in range based for loop in template function ]]
Reviewers: aaron.ballman, alexfh, hokein, JonasToth, gribozavr2
Reviewed By: aaron.ballman
Subscribers: merge_guards_bot, xazax.hun, wuzish, nemanjai, kbarton, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D73843
(cherry picked from commit efcd09cea9a51c522954aa24e4b5513266daf6c3)
Diffstat (limited to 'clang-tools-extra/test/clang-tidy')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-init-variables.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-init-variables.cpp b/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-init-variables.cpp index d43e44808a4..4c92e1976f9 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-init-variables.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-init-variables.cpp @@ -78,3 +78,9 @@ void init_unit_tests() { int parens(42); int braces{42}; } + +template <typename RANGE> +void f(RANGE r) { + for (char c : r) { + } +} |