From 2dca6244145ec31a690d345faaf189430171cfac Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Tue, 27 May 2025 16:41:13 +0200 Subject: [PATCH] lp_data: Fix compilation (#4662) --- ortools/lp_data/lp_parser.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ortools/lp_data/lp_parser.cc b/ortools/lp_data/lp_parser.cc index f41e28626a..c8654c49e1 100644 --- a/ortools/lp_data/lp_parser.cc +++ b/ortools/lp_data/lp_parser.cc @@ -237,6 +237,9 @@ bool LPParser::ParseConstraint(StringPiece constraint) { namespace { +template +constexpr bool dependent_false = false; // workaround before CWG2518/P2593R1 + template bool SimpleAtoFractional(absl::string_view str, T* value) { if constexpr (std::is_same_v) { @@ -244,7 +247,7 @@ bool SimpleAtoFractional(absl::string_view str, T* value) { } else if constexpr (std::is_same_v) { return absl::SimpleAtof(str, value); } else { - static_assert(false, "Unsupported fractional type"); + static_assert(dependent_false, "Unsupported fractional type"); return false; } }