alexfh added inline comments.

================
Comment at: clang-tidy/misc/SuspiciousEnumUsageCheck.cpp:155
+
+    if (EnumDec->enumerator_begin() == EnumDec->enumerator_end() ||
+        OtherEnumDec->enumerator_begin() == OtherEnumDec->enumerator_end())
----------------
szepet wrote:
> alexfh wrote:
> > Why?
> Because the hasDisjointValueRange function could not decide the values 
> properly. So in case of an empty Enum it would not make sense. Fortunately we 
> know that the empty case should not be reported so used early return on this.
> 
> That is why this is needed if we want a deterministic check. 
BTW, this might make sense to be explained in the comment in the code itself 
(code review comments are bad means of documenting code).


https://reviews.llvm.org/D22507



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to