From 14682c1ece962b820925ec7c4876424651be1311 Mon Sep 17 00:00:00 2001 From: Mark Gillard Date: Wed, 21 Apr 2021 15:36:25 +0300 Subject: [PATCH] fixed `TOML_CONSTEVAL` breaking on VS 16.10.0pre2 (closes #93) https://developercommunity.visualstudio.com/t/Erroneous-C7595-error-with-consteval-in/1404234 --- include/toml++/toml_preprocessor.h | 4 +++- toml.hpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/toml++/toml_preprocessor.h b/include/toml++/toml_preprocessor.h index b2357b6..38b1f31 100644 --- a/include/toml++/toml_preprocessor.h +++ b/include/toml++/toml_preprocessor.h @@ -459,7 +459,9 @@ is no longer necessary. #define TOML_NO_DEFAULT_CASE default: TOML_UNREACHABLE -#ifdef __cpp_consteval +#if defined(__cpp_consteval) \ + && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER != 192930031) + // https://developercommunity.visualstudio.com/t/Erroneous-C7595-error-with-consteval-in/1404234 #define TOML_CONSTEVAL consteval #else #define TOML_CONSTEVAL constexpr diff --git a/toml.hpp b/toml.hpp index dfffefc..979b096 100644 --- a/toml.hpp +++ b/toml.hpp @@ -470,7 +470,9 @@ is no longer necessary. #define TOML_NO_DEFAULT_CASE default: TOML_UNREACHABLE -#ifdef __cpp_consteval +#if defined(__cpp_consteval) \ + && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER != 192930031) + // https://developercommunity.visualstudio.com/t/Erroneous-C7595-error-with-consteval-in/1404234 #define TOML_CONSTEVAL consteval #else #define TOML_CONSTEVAL constexpr