summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2022-11-14 17:53:27 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2022-11-14 17:53:27 -0500
commit9e4e9b6fcc88779443e8d2315106d416de1b0761 (patch)
treee34ace05823a23ea707f3e1ca450c4e0a8237e20
parent7cb909e6fbf19030cfc0912d2460b9b950814b4e (diff)
downloadorcus-master.tar.gz
Fix MSVC build HEADmaster
gcc apparently has no issues with std::optional<auto> but MSVC does. Not sure about clang.
-rw-r--r--src/orcus_test_xls_xml.cpp2
-rw-r--r--src/spreadsheet/debug_state_dumper.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/orcus_test_xls_xml.cpp b/src/orcus_test_xls_xml.cpp
index 97e13dfb..627c957d 100644
--- a/src/orcus_test_xls_xml.cpp
+++ b/src/orcus_test_xls_xml.cpp
@@ -1726,7 +1726,7 @@ void test_xls_xml_skip_error_cells()
(void)doc;
assert(!"exception was expected, but was not thrown.");
}
- catch (const std::exception& e)
+ catch (const std::exception&)
{
// works as expected
}
diff --git a/src/spreadsheet/debug_state_dumper.cpp b/src/spreadsheet/debug_state_dumper.cpp
index a8291c84..57650d14 100644
--- a/src/spreadsheet/debug_state_dumper.cpp
+++ b/src/spreadsheet/debug_state_dumper.cpp
@@ -77,8 +77,10 @@ void doc_debug_state_dumper::dump_styles(const fs::path& outdir) const
<< " shrink-to-fit: " << to_string(xf.shrink_to_fit) << std::endl;
};
- auto optional_value = [&of](std::string_view name, const std::optional<auto>& v, int level=2)
+ auto optional_value = [&of](std::string_view name, const auto& v, int level=2)
{
+ // v is of type std::optional<T>.
+
constexpr char q = '"';
constexpr const char* indent_unit_s = " ";