llvm-project/clang-tools-extra/test
Roman Lebedev eb6d821cda [clang-tidy] readability-function-size: fix nesting level calculation
Summary:
A followup for D32942.

Malcolm Parsons has provided a valid testcase that the initial version of the check complained about nested `if`'s.
As it turns out, the culprit is the **partially** un-intentional `switch` fallthrough.
So rewrite the NestingThreshold logic without ab-using+mis-using that switch with fallthrough, and add testcases with nested `if`' where there should be a warning and shouldn't be a warning. This results in a cleaner, simpler code, too.

I guess, now it would be actually possible to pick some reasonable default for `NestingThreshold` setting.

Fixes PR33454.

Reviewers: malcolm.parsons, alexfh

Reviewed By: malcolm.parsons

Subscribers: sbenza, xazax.hun, cfe-commits, aaron.ballman

Tags: #clang-tools-extra

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

llvm-svn: 305554
2017-06-16 13:07:47 +00:00
..
Unit Replace hardcoded comment at 'lit.site.cfg.in' 2016-04-16 07:01:42 +00:00
change-namespace [change-namepsace] make it possible to whitelist symbols so they don't get updated. 2017-02-24 11:54:45 +00:00
clang-apply-replacements [clang-tidy] Add check name to YAML export (clang-tools-extra part) 2017-01-03 14:36:13 +00:00
clang-move [clang-move] Extend clang-move to support moving global variable. 2017-02-27 13:19:13 +00:00
clang-query Add a makefile for clang-query. Patch by Alex Horn! 2014-02-18 19:46:01 +00:00
clang-rename clang-rename: add new -force option 2017-06-02 09:32:28 +00:00
clang-reorder-fields Add clang-reorder-fields to clang-tools-extra 2016-09-02 02:56:07 +00:00
clang-tidy [clang-tidy] readability-function-size: fix nesting level calculation 2017-06-16 13:07:47 +00:00
clangd [clangd] Add priority to completion item sort text 2017-06-15 09:11:57 +00:00
include-fixer [include-fixer] Add fuzzy SymbolIndex, where identifier needn't match exactly. 2017-03-13 15:55:59 +00:00
modularize Fixed some cases in the modularize assistant mode where header file names didn't translate to valid module names. 2016-03-21 23:05:14 +00:00
pp-trace Fix tests to not assume they know exactly what will be in Clang's predefines buffer. 2016-09-30 23:47:58 +00:00
.clang-format Add a .clang-format to avoid reflow of test RUN lines 2013-12-01 05:08:00 +00:00
CMakeLists.txt clang-tools-extra/test/CMakeLists.txt: Rework r297806 (D29851) to make sure test utils should be built. 2017-04-30 03:19:04 +00:00
lit.cfg [find-all-symbols] Add a test to make sure merging actually works. 2016-05-31 12:12:19 +00:00
lit.site.cfg.in Replace hardcoded comment at 'lit.site.cfg.in' 2016-04-16 07:01:42 +00:00