================
@@ -225,10 +225,12 @@ void FunctionSizeCheck::check(const
MatchFinder::MatchResult &Result) {
<< ActualNumberParameters << ParameterThreshold.value();
}
- for (const auto &CSPos : FI.NestingThresholders) {
- diag(CSPos, "nesting level %0 starts here (threshold %1)",
- DiagnosticIDs::Note)
- << NestingThreshold.value() + 1 << NestingThreshold.value();
+ if (NestingThreshold) {
+ for (const auto &CSPos : FI.NestingThresholders) {
+ diag(CSPos, "nesting level %0 starts here (threshold %1)",
+ DiagnosticIDs::Note)
+ << NestingThreshold.value() + 1 << NestingThreshold.value();
----------------
localspook wrote:
For consistency with the rest of the code, and to assert that we really do
expect the optional to be engaged:
```suggestion
<< *NestingThreshold + 1 << *NestingThreshold;
```
https://github.com/llvm/llvm-project/pull/170004
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits