From 88c2e4377df7dbe65bc8ef629ea409cd9df6a860 Mon Sep 17 00:00:00 2001 From: Jakub Szewczyk Date: Fri, 18 Mar 2022 22:10:04 +0000 Subject: Fix errors when building in C++20 mode (#4528) * use [[noreturn]] available since C++11 instead of compiler-specific attributes * replace deprecated std::is_pod with is_trivial&&is_standard_layout (also available since C++11/14) * explicitly capture this in [=] lambdas * extra const functions in FeatureSet, fix implicit cast warning by using the features field directly * Use CMAKE_CXX_STANDARD to ensure the C++ standard parameter is set on all targets, remove manual compiler flag workaround. --- src/tools/tool-options.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools/tool-options.h') diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h index 0ed0f27fb..f8278e950 100644 --- a/src/tools/tool-options.h +++ b/src/tools/tool-options.h @@ -155,7 +155,7 @@ struct ToolOptions : public Options { std::string("Enable ") + description, ToolOptionsCategory, Arguments::Zero, - [=](Options*, const std::string&) { + [this, feature](Options*, const std::string&) { enabledFeatures.set(feature, true); disabledFeatures.set(feature, false); }) @@ -165,7 +165,7 @@ struct ToolOptions : public Options { std::string("Disable ") + description, ToolOptionsCategory, Arguments::Zero, - [=](Options*, const std::string&) { + [this, feature](Options*, const std::string&) { enabledFeatures.set(feature, false); disabledFeatures.set(feature, true); }); -- cgit v1.2.3