diff --git a/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp b/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp index c4a51fad7272..5252087d55ee 100644 --- a/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp +++ b/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp @@ -69,7 +69,7 @@ std::vector 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; }