diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h index 28d923d9d543..163c353681bc 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h +++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h @@ -174,7 +174,8 @@ public: return DiagLevelAndFormatString( static_cast( DiagEngine->getDiagnosticLevel(DiagnosticID, Loc)), - DiagEngine->getDiagnosticIDs()->getDescription(DiagnosticID)); + std::string( + DiagEngine->getDiagnosticIDs()->getDescription(DiagnosticID))); } private: