PiotrZSL added inline comments.

================
Comment at: clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp:97
+  const auto CharToIntCastExpr = implicitCastExpr(
+      hasSourceExpression(expr(hasType(qualType(isAnyCharacter())))),
+      hasImplicitDestinationType(NonCharacterInteger));
----------------
PiotrZSL wrote:
> reuse here CharExpr 
try with test like this:

```
struct Class
{
   operator char() const;
};

Class c;
std::string value(c, 5);
```

I fear that hasSourceExpression could match Class type, and therefore this case 
wouldn't be detected.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143971

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

Reply via email to