diff --git a/clang/include/clang/Sema/ParsedAttr.h b/clang/include/clang/Sema/ParsedAttr.h index 922a818a48aed..661c193577a69 100644 --- a/clang/include/clang/Sema/ParsedAttr.h +++ b/clang/include/clang/Sema/ParsedAttr.h @@ -1110,6 +1110,18 @@ enum AttributeDeclKind { ExpectedTypedef, }; +inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, + const ParsedAttr &At) { + + if (At.printMacroName()) { + const IdentifierInfo *AttrName = At.getMacroIdentifier(); + DB.AddTaggedVal(reinterpret_cast(AttrName), + DiagnosticsEngine::ak_identifierinfo); + return DB; + } + return DB << &At; +} + } // namespace clang #endif // LLVM_CLANG_SEMA_PARSEDATTR_H