[libc++] Fixes clang-tidy plugin for clang-tidy 17.
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
This commit is contained in:
parent
94daee2e73
commit
81fb5a0e1c
@ -69,7 +69,7 @@ std::vector<const char*> get_standard_attributes(const clang::LangOptions& lang_
|
||||
}
|
||||
|
||||
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()))
|
||||
@ -80,8 +80,7 @@ AST_MATCHER(clang::Attr, isPretty) {
|
||||
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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user