Jelajahi Sumber

Enable some additional warnings. (#675)

Geoff Romer 4 tahun lalu
induk
melakukan
d4ed6b1083

+ 2 - 0
bazel/cc_toolchains/clang_cc_toolchain_config.bzl

@@ -124,6 +124,8 @@ def _impl(ctx):
                             "-Wextra",
                             "-Wthread-safety",
                             "-Wself-assign",
+                            "-Wimplicit-fallthrough",
+                            "-Wctad-maybe-unsupported",
                             # Unfortunately, LLVM isn't clean for this warning.
                             "-Wno-unused-parameter",
                             # We use partial sets of designated initializers in

+ 5 - 0
executable_semantics/interpreter/stack.h

@@ -72,6 +72,11 @@ struct Stack {
   std::vector<T> elements;
 };
 
+// Explicitly enable CTAD to silence warnings.
+// TODO: consider removing this (and perhaps the associated constructor).
+template <typename T>
+Stack(T x) -> Stack<T>;
+
 }  // namespace Carbon
 
 #endif  // EXECUTABLE_SEMANTICS_INTERPRETER_CONS_LIST_H_