[PATCH] D23595: [Clang] Fix some Clang-tidy modernize-use-using and Include What You Use warnings
Eugene Zelenko via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 26 16:15:40 PDT 2016
Eugene.Zelenko added inline comments.
================
Comment at: include/clang/Basic/IdentifierTable.h:103
@@ -95,1 +102,3 @@
+ return getLength() == StrLen-1 &&
+ memcmp(getNameStart(), Str, StrLen-1) == 0;
}
----------------
mehdi_amini wrote:
> Eugene.Zelenko wrote:
> > memcpy result is three state, so applying Boolean operator is not correct.
> What do you mean "applying Boolean operator is not correct"?
> http://en.cppreference.com/w/cpp/language/implicit_conversion # Boolean conversions
> ```The value zero (for integral, floating-point, and unscoped enumeration) and the null pointer and the null pointer-to-member values become false. All other values become true.```
>
> Seems good to me?
>
I think explicit operation is more comprehensible them implicit.
================
Comment at: include/clang/Lex/PreprocessorOptions.h:22
@@ -23,2 +21,3 @@
namespace llvm {
+
class MemoryBuffer;
----------------
mehdi_amini wrote:
> Eugene.Zelenko wrote:
> > I wanted to make spacing consistent. Same in other places.
> >
> > Actually, Include What You Use recommended to include MemoryBuffer.h. MemoryBuffer is used in smart pointers, but I remember that I encountered problems in LLDB MSVC builds, where forward declaration was not enough for such usage.
> I think in a recent review you mentioned "empty lines make code more readable for large namespaces", which does not seem to be the case here?
I prefer spacing to be consistent.
Repository:
rL LLVM
https://reviews.llvm.org/D23595
More information about the cfe-commits
mailing list