diff --git a/include/vcpkg/base/diagnostics.h b/include/vcpkg/base/diagnostics.h index 296b5ae75a..5a8238f02a 100644 --- a/include/vcpkg/base/diagnostics.h +++ b/include/vcpkg/base/diagnostics.h @@ -193,7 +193,6 @@ namespace vcpkg } // If Ty is a std::unique_ptr, typename AdaptContextDetectUniquePtr::type is the type necessary to return - // and fwd is the type necessary to move if necessary. Otherwise, there are no members ::type or ::fwd template struct AdaptContextDetectUniquePtr { diff --git a/include/vcpkg/base/fwd/parse.h b/include/vcpkg/base/fwd/parse.h index 633ed0c138..0fb14a3f81 100644 --- a/include/vcpkg/base/fwd/parse.h +++ b/include/vcpkg/base/fwd/parse.h @@ -12,6 +12,5 @@ namespace vcpkg }; struct ParseMessage; - struct ParseMessages; struct ParserBase; } diff --git a/include/vcpkg/base/parse.h b/include/vcpkg/base/parse.h index 7dec02083f..2988606b4b 100644 --- a/include/vcpkg/base/parse.h +++ b/include/vcpkg/base/parse.h @@ -28,15 +28,6 @@ namespace vcpkg LocalizedString format(StringView origin, MessageKind kind) const; }; - struct ParseMessages - { - Optional error; - std::vector warnings; - - void exit_if_errors_or_warnings(StringView origin) const; - bool good() const { return !error && warnings.empty(); } - }; - struct ParserBase { ParserBase(DiagnosticContext& context, StringView text, StringView origin, TextRowCol init_rowcol = {1, 1}); diff --git a/src/vcpkg-test/ci-baseline.cpp b/src/vcpkg-test/ci-baseline.cpp index 10df074e58..af0f07b224 100644 --- a/src/vcpkg-test/ci-baseline.cpp +++ b/src/vcpkg-test/ci-baseline.cpp @@ -203,7 +203,7 @@ bill-made-up-another-skip:x64-linux=skip)"; // note no trailing newline } else { - FAIL(); + FAIL(context.to_string()); } } @@ -219,7 +219,7 @@ bill-made-up-another-skip:x64-linux=skip)"; // note no trailing newline } else { - FAIL(); + FAIL(context.to_string()); } } diff --git a/src/vcpkg/base/diagnostics.cpp b/src/vcpkg/base/diagnostics.cpp index dd10961329..38ec19fb02 100644 --- a/src/vcpkg/base/diagnostics.cpp +++ b/src/vcpkg/base/diagnostics.cpp @@ -10,9 +10,7 @@ namespace { static constexpr StringLiteral ColonSpace{": "}; - void append_file_prefix(std::string& target, - const Optional& maybe_origin, - const TextRowCol& position) + void append_file_prefix(std::string& target, const Optional& maybe_origin, const TextRowCol& position) { // file:line:col: kind: message if (auto origin = maybe_origin.get()) diff --git a/src/vcpkg/base/parse.cpp b/src/vcpkg/base/parse.cpp index 867c82577f..e8e5a3b5f0 100644 --- a/src/vcpkg/base/parse.cpp +++ b/src/vcpkg/base/parse.cpp @@ -72,24 +72,6 @@ namespace vcpkg return res; } - void ParseMessages::exit_if_errors_or_warnings(StringView origin) const - { - for (const auto& warning : warnings) - { - msg::println(warning.format(origin, MessageKind::Warning)); - } - - if (auto e = error.get()) - { - Checks::msg_exit_with_message(VCPKG_LINE_INFO, *e); - } - - if (!warnings.empty()) - { - Checks::msg_exit_with_error(VCPKG_LINE_INFO, msgWarningsTreatedAsErrors); - } - } - ParserBase::ParserBase(DiagnosticContext& context, StringView text, StringView origin, TextRowCol init_rowcol) : m_it(text.begin(), text.end()) , m_start_of_line(m_it)