From 653764d53bbc6efadf643625d89cb100a7754483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sun, 21 Feb 2021 11:19:02 +0100 Subject: [PATCH] Simplify workaround for MSVC issue with XmlWriter --- src/catch2/internal/catch_xmlwriter.cpp | 6 ++++-- src/catch2/internal/catch_xmlwriter.hpp | 7 ------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp index f69256cf..4ea09ab5 100644 --- a/src/catch2/internal/catch_xmlwriter.cpp +++ b/src/catch2/internal/catch_xmlwriter.cpp @@ -5,9 +5,11 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#include - +// Note: swapping these two includes around causes MSVC to error out +// while in /permissive- mode. No, I don't know why. +// Tested on VS 2019, 18.{3, 4}.x #include +#include #include #include diff --git a/src/catch2/internal/catch_xmlwriter.hpp b/src/catch2/internal/catch_xmlwriter.hpp index c2e7473e..e1e99659 100644 --- a/src/catch2/internal/catch_xmlwriter.hpp +++ b/src/catch2/internal/catch_xmlwriter.hpp @@ -10,13 +10,6 @@ #include -// FixMe: Without this include (and something inside it), MSVC goes crazy -// and reports that calls to XmlEncode's op << are ambiguous between -// the declaration and definition. -// It also has to be in the header. -#include - - #include namespace Catch {