summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--src/analysis/lattices/inverted.h3
-rw-r--r--src/analysis/lattices/lift.h3
-rw-r--r--src/analysis/lattices/shared.h3
-rw-r--r--src/analysis/lattices/stack.h3
-rw-r--r--src/analysis/lattices/vector.h3
-rw-r--r--src/analysis/monotone-analyzer.h4
-rw-r--r--src/wasm-type-printing.h6
8 files changed, 30 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2aefeef05..4727100de 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -280,6 +280,11 @@ else()
add_compile_flag("-Wimplicit-fallthrough")
add_compile_flag("-Wnon-virtual-dtor")
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ # Google style requires this, so make sure we compile cleanly with it.
+ add_compile_flag("-Wctad-maybe-unsupported")
+ endif()
+
if(WIN32)
add_compile_flag("-D_GNU_SOURCE")
add_compile_flag("-D__STDC_FORMAT_MACROS")
diff --git a/src/analysis/lattices/inverted.h b/src/analysis/lattices/inverted.h
index 22e326742..b70e58968 100644
--- a/src/analysis/lattices/inverted.h
+++ b/src/analysis/lattices/inverted.h
@@ -49,6 +49,9 @@ template<FullLattice L> struct Inverted {
}
};
+// Deduction guide.
+template<typename L> Inverted(L&&) -> Inverted<L>;
+
#if __cplusplus >= 202002L
static_assert(Lattice<Inverted<Bool>>);
#endif
diff --git a/src/analysis/lattices/lift.h b/src/analysis/lattices/lift.h
index ba711ac65..ec0f57967 100644
--- a/src/analysis/lattices/lift.h
+++ b/src/analysis/lattices/lift.h
@@ -74,6 +74,9 @@ template<Lattice L> struct Lift {
}
};
+// Deduction guide.
+template<typename L> Lift(L&&) -> Lift<L>;
+
#if __cplusplus >= 202002L
static_assert(Lattice<Lift<Bool>>);
#endif
diff --git a/src/analysis/lattices/shared.h b/src/analysis/lattices/shared.h
index e75b895ea..54acf92b4 100644
--- a/src/analysis/lattices/shared.h
+++ b/src/analysis/lattices/shared.h
@@ -118,6 +118,9 @@ template<Lattice L> struct Shared {
}
};
+// Deduction guide.
+template<typename L> Shared(L&&) -> Shared<L>;
+
#if __cplusplus >= 202002L
static_assert(Lattice<Shared<Bool>>);
#endif // __cplusplus >= 202002L
diff --git a/src/analysis/lattices/stack.h b/src/analysis/lattices/stack.h
index ad71cb1ac..c27965116 100644
--- a/src/analysis/lattices/stack.h
+++ b/src/analysis/lattices/stack.h
@@ -179,6 +179,9 @@ template<Lattice L> struct Stack {
}
};
+// Deduction guide.
+template<typename L> Stack(L&&) -> Stack<L>;
+
#if __cplusplus >= 202002L
static_assert(Lattice<Stack<Bool>>);
#endif
diff --git a/src/analysis/lattices/vector.h b/src/analysis/lattices/vector.h
index 175ec5e3c..050b0f408 100644
--- a/src/analysis/lattices/vector.h
+++ b/src/analysis/lattices/vector.h
@@ -151,6 +151,9 @@ private:
}
};
+// Deduction guide.
+template<typename L> Vector(L&&, size_t) -> Vector<L>;
+
#if __cplusplus >= 202002L
static_assert(FullLattice<Vector<Bool>>);
static_assert(Lattice<Vector<Flat<bool>>>);
diff --git a/src/analysis/monotone-analyzer.h b/src/analysis/monotone-analyzer.h
index 5ca8caacc..c2ec7c2b4 100644
--- a/src/analysis/monotone-analyzer.h
+++ b/src/analysis/monotone-analyzer.h
@@ -55,6 +55,10 @@ public:
void print(std::ostream& os);
};
+// Deduction guide.
+template<typename L, typename TxFn>
+MonotoneCFGAnalyzer(L&, TxFn&, CFG&) -> MonotoneCFGAnalyzer<L, TxFn>;
+
} // namespace wasm::analysis
#include "monotone-analyzer-impl.h"
diff --git a/src/wasm-type-printing.h b/src/wasm-type-printing.h
index c7277e96d..11afde882 100644
--- a/src/wasm-type-printing.h
+++ b/src/wasm-type-printing.h
@@ -95,6 +95,9 @@ struct IndexedTypeNameGenerator
}
};
+// Deduction guide.
+template<typename T> IndexedTypeNameGenerator(T&) -> IndexedTypeNameGenerator<>;
+
// Prints heap types stored in a module, falling back to the given
// FallbackGenerator if the module does not have a name for type type.
template<typename FallbackGenerator = DefaultTypeNameGenerator>
@@ -122,6 +125,9 @@ struct ModuleTypeNameGenerator
}
};
+// Deduction guide.
+ModuleTypeNameGenerator(const Module&) -> ModuleTypeNameGenerator<>;
+
} // namespace wasm
#endif // wasm_wasm_type_printing_h