baloghadamsoftware marked 2 inline comments as done.
baloghadamsoftware added inline comments.
================
Comment at:
clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp:43
+static bool isLiteral(const Expr *E) {
+ return isa<StringLiteral>(E) ||
+ isa<CharacterLiteral>(E) ||
----------------
aaron.ballman wrote:
> What about other kinds of literals like user-defined literals, or literal
> class types? Should this be using `E->getType()->isLiteralType()`?
`E->getType()->isLiteralType()` does not work since it tells about the type,
not the expression itself. Here we should return `true` for literals only, not
for any expressions whose type is a literal type. Thus `int` is a literal type,
`5` is an `int` literal, but `n` or `return_any_int()` not.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71199/new/
https://reviews.llvm.org/D71199
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits