summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2022-10-13 15:35:18 -0500
committerGitHub <noreply@github.com>2022-10-13 20:35:18 +0000
commit577376d181a06ae2d053b503b95e5d7ea571c638 (patch)
tree20261e886832494eddb88177564206921fee57bf
parent7183a3be321ac76abcede1ecb05d5eea8d42d78f (diff)
downloadbinaryen-577376d181a06ae2d053b503b95e5d7ea571c638.tar.gz
binaryen-577376d181a06ae2d053b503b95e5d7ea571c638.tar.bz2
binaryen-577376d181a06ae2d053b503b95e5d7ea571c638.zip
[NFC] Add an explicit deduction guide for `WithPosition` (#5140)
Since our usage of `WithPosition` depends on C++17 class template argument deduction, it triggers a clang warning `-Wctad-maybe-unsupported`. Silence the warning by providing an explicit deduction guide.
-rw-r--r--src/wasm/wat-parser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm/wat-parser.cpp b/src/wasm/wat-parser.cpp
index bba751c71..23961ac3f 100644
--- a/src/wasm/wat-parser.cpp
+++ b/src/wasm/wat-parser.cpp
@@ -325,6 +325,9 @@ template<typename Ctx> struct WithPosition {
~WithPosition() { ctx.in.lexer.setIndex(original); }
};
+// Deduction guide to satisfy -Wctad-maybe-unsupported.
+template<typename Ctx> WithPosition(Ctx& ctx, Index) -> WithPosition<Ctx>;
+
using IndexMap = std::unordered_map<Name, Index>;
void applyImportNames(Importable& item,