diff --git a/cmake/patches/0001-fix-skip-install-rules.patch b/cmake/patches/0001-fix-skip-install-rules.patch index caa4299..d20445a 100644 --- a/cmake/patches/0001-fix-skip-install-rules.patch +++ b/cmake/patches/0001-fix-skip-install-rules.patch @@ -1,25 +1,25 @@ -From 857dc932fc32d3a1d30abac7724565812b446cd2 Mon Sep 17 00:00:00 2001 +From d924c3bf4d83e9ef3ce66a6ac1e80ef1cb7cc4ca Mon Sep 17 00:00:00 2001 From: Ruslan Morozov -Date: Thu, 8 Dec 2022 21:11:49 +0300 -Subject: [PATCH] fix skip install rules +Date: Sat, 3 Jun 2023 12:21:15 +0300 +Subject: [PATCH] [PATCH] fix skip install rules --- include/BoostRoot.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/include/BoostRoot.cmake b/tools/cmake/include/BoostRoot.cmake -index f2a51e1..a37f14d 100644 +index e93f907..f0380b3 100644 --- a/tools/cmake/include/BoostRoot.cmake +++ b/tools/cmake/include/BoostRoot.cmake -@@ -90,7 +90,7 @@ else() +@@ -108,7 +108,7 @@ else() endif() set(BUILD_TESTING OFF) -- set(CMAKE_SKIP_INSTALL_RULES ON) -+ set(CMAKE_SKIP_INSTALL_RULES OFF) +- set(BOOST_SKIP_INSTALL_RULES ON) ++ set(BOOST_SKIP_INSTALL_RULES OFF) endif() -- -2.37.1 (Apple Git-137.1) +2.39.2 (Apple Git-143) diff --git a/src/expression_evaluator.cpp b/src/expression_evaluator.cpp index da8618c..136e33d 100644 --- a/src/expression_evaluator.cpp +++ b/src/expression_evaluator.cpp @@ -424,6 +424,8 @@ Result ParseCallParamsImpl(const T& args, const P& params, bool& isSucceeded) int firstMandatoryIdx = -1; int prevNotFound = -1; int foundKwArgs = 0; + (void)foundKwArgs; // extremely odd bug in clang warning + // Wunused-but-set-variable // Find all provided keyword args for (auto& argInfo : args) @@ -441,7 +443,7 @@ Result ParseCallParamsImpl(const T& args, const P& params, bool& isSucceeded) { result.args[argInfo.name] = p->second; argsInfo[argIdx].state = Keyword; - ++ foundKwArgs; + ++foundKwArgs; } else { diff --git a/src/robin_hood.h b/src/robin_hood.h index 511a308..b4e0fbc 100644 --- a/src/robin_hood.h +++ b/src/robin_hood.h @@ -36,7 +36,7 @@ // see https://semver.org/ #define ROBIN_HOOD_VERSION_MAJOR 3 // for incompatible API changes #define ROBIN_HOOD_VERSION_MINOR 11 // for adding functionality in a backwards-compatible manner -#define ROBIN_HOOD_VERSION_PATCH 3 // for backwards-compatible bug fixes +#define ROBIN_HOOD_VERSION_PATCH 5 // for backwards-compatible bug fixes #include #include @@ -206,7 +206,7 @@ static Counts& counts() { // workaround missing "is_trivially_copyable" in g++ < 5.0 // See https://stackoverflow.com/a/31798726/48181 -#if defined(__GNUC__) && __GNUC__ < 5 +#if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__) # define ROBIN_HOOD_IS_TRIVIALLY_COPYABLE(...) __has_trivial_copy(__VA_ARGS__) #else # define ROBIN_HOOD_IS_TRIVIALLY_COPYABLE(...) std::is_trivially_copyable<__VA_ARGS__>::value @@ -1820,6 +1820,12 @@ class Table InsertionState::key_found != idxAndState.second); } + template + iterator emplace_hint(const_iterator position, Args&&... args) { + (void)position; + return emplace(std::forward(args)...).first; + } + template std::pair try_emplace(const key_type& key, Args&&... args) { return try_emplace_impl(key, std::forward(args)...); @@ -1831,16 +1837,15 @@ class Table } template - std::pair try_emplace(const_iterator hint, const key_type& key, - Args&&... args) { + iterator try_emplace(const_iterator hint, const key_type& key, Args&&... args) { (void)hint; - return try_emplace_impl(key, std::forward(args)...); + return try_emplace_impl(key, std::forward(args)...).first; } template - std::pair try_emplace(const_iterator hint, key_type&& key, Args&&... args) { + iterator try_emplace(const_iterator hint, key_type&& key, Args&&... args) { (void)hint; - return try_emplace_impl(std::move(key), std::forward(args)...); + return try_emplace_impl(std::move(key), std::forward(args)...).first; } template @@ -1854,16 +1859,15 @@ class Table } template - std::pair insert_or_assign(const_iterator hint, const key_type& key, - Mapped&& obj) { + iterator insert_or_assign(const_iterator hint, const key_type& key, Mapped&& obj) { (void)hint; - return insertOrAssignImpl(key, std::forward(obj)); + return insertOrAssignImpl(key, std::forward(obj)).first; } template - std::pair insert_or_assign(const_iterator hint, key_type&& key, Mapped&& obj) { + iterator insert_or_assign(const_iterator hint, key_type&& key, Mapped&& obj) { (void)hint; - return insertOrAssignImpl(std::move(key), std::forward(obj)); + return insertOrAssignImpl(std::move(key), std::forward(obj)).first; } std::pair insert(const value_type& keyval) { @@ -1871,10 +1875,20 @@ class Table return emplace(keyval); } + iterator insert(const_iterator hint, const value_type& keyval) { + (void)hint; + return emplace(keyval).first; + } + std::pair insert(value_type&& keyval) { return emplace(std::move(keyval)); } + iterator insert(const_iterator hint, value_type&& keyval) { + (void)hint; + return emplace(std::move(keyval)).first; + } + // Returns 1 if key is found, 0 otherwise. size_t count(const key_type& key) const { // NOLINT(modernize-use-nodiscard) ROBIN_HOOD_TRACE(this) @@ -2308,13 +2322,14 @@ class Table auto const numElementsWithBuffer = calcNumElementsWithBuffer(max_elements); - // calloc also zeroes everything + // malloc & zero mInfo. Faster than calloc everything. auto const numBytesTotal = calcNumBytesTotal(numElementsWithBuffer); ROBIN_HOOD_LOG("std::calloc " << numBytesTotal << " = calcNumBytesTotal(" << numElementsWithBuffer << ")") mKeyVals = reinterpret_cast( - detail::assertNotNull(std::calloc(1, numBytesTotal))); + detail::assertNotNull(std::malloc(numBytesTotal))); mInfo = reinterpret_cast(mKeyVals + numElementsWithBuffer); + std::memset(mInfo, 0, numBytesTotal - numElementsWithBuffer * sizeof(Node)); // set sentinel mInfo[numElementsWithBuffer] = 1; diff --git a/src/template_parser.cpp b/src/template_parser.cpp index f715d9a..bd09039 100644 --- a/src/template_parser.cpp +++ b/src/template_parser.cpp @@ -1,4 +1,5 @@ #include "template_parser.h" +#include "renderer.h" #include namespace jinja2 @@ -203,7 +204,7 @@ StatementsParser::ParseResult StatementsParser::ParseEndFor(LexScanner&, Stateme { auto r = std::static_pointer_cast(info.renderer); r->SetMainBody(info.compositions[0]); - elseRenderer = r; + elseRenderer = std::static_pointer_cast(r); statementsInfo.pop_back(); info = statementsInfo.back(); @@ -246,7 +247,7 @@ StatementsParser::ParseResult StatementsParser::ParseElse(LexScanner& /*lexer*/, { auto renderer = std::make_shared(ExpressionEvaluatorPtr<>()); StatementInfo statementInfo = StatementInfo::Create(StatementInfo::ElseIfStatement, stmtTok); - statementInfo.renderer = renderer; + statementInfo.renderer = std::static_pointer_cast(renderer); statementsInfo.push_back(statementInfo); return ParseResult(); } @@ -262,7 +263,7 @@ StatementsParser::ParseResult StatementsParser::ParseElIf(LexScanner& lexer, Sta auto renderer = std::make_shared(*valueExpr); StatementInfo statementInfo = StatementInfo::Create(StatementInfo::ElseIfStatement, stmtTok); - statementInfo.renderer = renderer; + statementInfo.renderer = std::static_pointer_cast(renderer); statementsInfo.push_back(statementInfo); return ParseResult(); } diff --git a/src/value_visitors.h b/src/value_visitors.h index 6157d29..4ac874f 100644 --- a/src/value_visitors.h +++ b/src/value_visitors.h @@ -25,7 +25,7 @@ namespace detail template struct RecursiveUnwrapper { - V* m_visitor; + V* m_visitor{}; RecursiveUnwrapper(V* v) : m_visitor(v) diff --git a/thirdparty/fmtlib b/thirdparty/fmtlib index a337011..a0b8a92 160000 --- a/thirdparty/fmtlib +++ b/thirdparty/fmtlib @@ -1 +1 @@ -Subproject commit a33701196adfad74917046096bf5a2aa0ab0bb50 +Subproject commit a0b8a92e3d1532361c2f7feb63babc5c18d00ef2 diff --git a/thirdparty/gtest b/thirdparty/gtest index aefb454..b796f7d 160000 --- a/thirdparty/gtest +++ b/thirdparty/gtest @@ -1 +1 @@ -Subproject commit aefb45469ee7e6bde0cd1d2c18412046c30e7bb6 +Subproject commit b796f7d44681514f58a683a3a71ff17c94edb0c1 diff --git a/thirdparty/json/rapid b/thirdparty/json/rapid index 80b6d1c..973dc9c 160000 --- a/thirdparty/json/rapid +++ b/thirdparty/json/rapid @@ -1 +1 @@ -Subproject commit 80b6d1c83402a5785c486603c5611923159d0894 +Subproject commit 973dc9c06dcd3d035ebd039cfb9ea457721ec213 diff --git a/thirdparty/nonstd/expected-lite b/thirdparty/nonstd/expected-lite index 22977a2..49af05a 160000 --- a/thirdparty/nonstd/expected-lite +++ b/thirdparty/nonstd/expected-lite @@ -1 +1 @@ -Subproject commit 22977a2a0aad56614cde2a8a1f9525f18053e24c +Subproject commit 49af05a2fdda423f8aa3918c2b96ccfa1857c3dd diff --git a/thirdparty/nonstd/optional-lite b/thirdparty/nonstd/optional-lite index 0854335..00e9cf5 160000 --- a/thirdparty/nonstd/optional-lite +++ b/thirdparty/nonstd/optional-lite @@ -1 +1 @@ -Subproject commit 0854335c64461d07d00f85b068075ed8871859ec +Subproject commit 00e9cf5ca5a496e857bc6a28ffed9f4189ce6646 diff --git a/thirdparty/nonstd/string-view-lite b/thirdparty/nonstd/string-view-lite index d27d7b5..5b1d95f 160000 --- a/thirdparty/nonstd/string-view-lite +++ b/thirdparty/nonstd/string-view-lite @@ -1 +1 @@ -Subproject commit d27d7b5081406a35b41cb16b321be8833b4cd811 +Subproject commit 5b1d95fe2c0ee18e654876487898b9a423a954db diff --git a/thirdparty/nonstd/variant-lite b/thirdparty/nonstd/variant-lite index 9499655..5015e84 160000 --- a/thirdparty/nonstd/variant-lite +++ b/thirdparty/nonstd/variant-lite @@ -1 +1 @@ -Subproject commit 9499655b9c263eaef735efeeb53892c770d447e1 +Subproject commit 5015e841cf143487f2d7e2f619b618d455658fab diff --git a/thirdparty/thirdparty-internal.cmake b/thirdparty/thirdparty-internal.cmake index 22af186..11de37e 100644 --- a/thirdparty/thirdparty-internal.cmake +++ b/thirdparty/thirdparty-internal.cmake @@ -18,7 +18,7 @@ include(FetchContent) FetchContent_Declare( Boost GIT_REPOSITORY https://github.com/boostorg/boost.git - GIT_TAG boost-1.80.0 + GIT_TAG boost-1.82.0 PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../cmake/patches/0001-fix-skip-install-rules.patch" || true ) FetchContent_MakeAvailable(Boost)