[PATCH] D131727: Enable -Wctad-maybe-unsupported in LLVM build
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 11 14:57:23 PDT 2022
dblaikie created this revision.
Herald added a subscriber: mgorny.
Herald added a project: All.
dblaikie requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
(this still has issues with the libcxx build where it warns, but doesn't
error - probably on some cases the warning shouldn't fire (it's not
meant to fire on standard library names - but some are just
implementation details of libcxx so not official standard library
names))
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D131727
Files:
llvm/cmake/modules/HandleLLVMOptions.cmake
llvm/include/llvm/CodeGen/RDFGraph.h
Index: llvm/include/llvm/CodeGen/RDFGraph.h
===================================================================
--- llvm/include/llvm/CodeGen/RDFGraph.h
+++ llvm/include/llvm/CodeGen/RDFGraph.h
@@ -934,6 +934,9 @@
const DataFlowGraph &G;
};
+ template<typename T>
+ Print(const T&, const DataFlowGraph&) -> Print<T>;
+
template <typename T>
struct PrintNode : Print<NodeAddr<T>> {
PrintNode(const NodeAddr<T> &x, const DataFlowGraph &g)
Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -791,6 +791,9 @@
# Prevent bugs that can happen with llvm's brace style.
add_flag_if_supported("-Wmisleading-indentation" MISLEADING_INDENTATION_FLAG)
+
+ # Enable -Wstring-conversion to catch misuse of string literals.
+ add_flag_if_supported("-Wctad-maybe-unsupported" CTAD_MAYBE_UNSPPORTED_FLAG)
endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131727.451993.patch
Type: text/x-patch
Size: 1133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220811/c5a07fa7/attachment.bin>
More information about the llvm-commits
mailing list