[PATCH] D90399: [clang-tidy] non-portable-integer-constant check

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 24 07:59:55 PDT 2021


steakhal added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/NonportableintegerconstantCheck.cpp:54
+
+    MaskStr = StringRef(MaskStr.lower());
+    if (!MaskStr.consume_front("0x"))
----------------
You are assigning a pointer to a temporal std::string. It will dangle.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/NonportableintegerconstantCheck.cpp:58
+
+    MaskStr = MaskStr.take_while(llvm::isHexDigit);
+
----------------
There could be digit separator apostrophes. E.g.: `0x44'4'4`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90399/new/

https://reviews.llvm.org/D90399



More information about the cfe-commits mailing list