When using with clang-tidy 17 Node.getAttrName() sometimes returns a
nullptr. This caused segfaults in the CI.
Reviewed By: philnik, #libc
Differential Revision: https://reviews.llvm.org/D151224
}
AST_MATCHER(clang::Attr, isPretty) {
- if (Node.isKeywordAttribute())
+ if (Node.isKeywordAttribute() || !Node.getAttrName())
return false;
if (Node.isCXX11Attribute() && !Node.hasScope()) {
if (isUgly(Node.getAttrName()->getName()))
if (Node.hasScope())
if (!isUgly(Node.getScopeName()->getName()))
return true;
- if (Node.getAttrName())
- return !isUgly(Node.getAttrName()->getName());
+ return !isUgly(Node.getAttrName()->getName());
return false;
}