[PATCH] D33844: [clang-tidy] terminating continue check
Jonas Toth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 27 10:42:38 PDT 2018
JonasToth added inline comments.
================
Comment at: test/clang-tidy/misc-terminating-continue.cpp:7
+ // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: terminating 'continue' [misc-terminating-continue]
+ } while(false);
+
----------------
Quuxplusone wrote:
> I initially expected to see tests also for
>
> goto L1;
> while (false) {
> L1:
> continue; // 'continue' is equivalent to 'break'
> }
>
> int v = 0;
> goto L1;
> for (; false; ++v) {
> L1:
> continue; // 'continue' is NOT equivalent to 'break'
> }
>
> although I assume your current patch doesn't actually diagnose the former, and that's probably fine.
I think both of your examples are out of scope for this check and are they realistic?
The usage of `goto` is addressed in `cppcoreguidelines-avoid-goto`
https://reviews.llvm.org/D33844
More information about the cfe-commits
mailing list