diff --git a/libnixf/include/nixf/Basic/Diagnostic.h b/libnixf/include/nixf/Basic/Diagnostic.h index 6a4c28976..9ec1d9a6b 100644 --- a/libnixf/include/nixf/Basic/Diagnostic.h +++ b/libnixf/include/nixf/Basic/Diagnostic.h @@ -164,13 +164,13 @@ class Diagnostic : public PartialDiagnostic { return Notes.emplace_back(Kind, Range); } - std::vector ¬es() { return Notes; } + [[nodiscard]] const std::vector ¬es() const { return Notes; } Fix &fix(std::string Message) { return Fixes.emplace_back(Fix{{}, std::move(Message)}); } - const std::vector &fixes() { return Fixes; } + [[nodiscard]] const std::vector &fixes() const { return Fixes; } [[nodiscard]] RangeTy range() const { return Range; }