[PATCH] D103938: Diagnose -Wunused-value based on CFG reachability
Nico Weber via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 21 13:28:48 PDT 2021
thakis added a comment.
This flags this code from absl:
template <typename ValueT, typename GenT,
typename std::enable_if<std::is_integral<ValueT>::value, int>::type =
(GenT{}, 0)>
constexpr FlagDefaultArg DefaultArg(int) {
return {FlagDefaultSrc(GenT{}.value), FlagDefaultKind::kOneWord};
}
(https://source.chromium.org/chromium/chromium/src/+/main:third_party/abseil-cpp/absl/flags/internal/flag.h;l=293?q=third_party%2Fabseil-cpp%2Fabsl%2Fflags%2Finternal%2Fflag.h)
../../third_party/abseil-cpp/absl/flags/internal/flag.h:293:16: warning: left operand of comma operator has no effect [-Wunused-value]
(GenT{}, 0)>
^ ~~
../../third_party/abseil-cpp/absl/flags/internal/flag.h:293:16: warning: left operand of comma operator has no effect [-Wunused-value]
(GenT{}, 0)>
^ ~~
I guess it has a SFINAE effect there?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103938/new/
https://reviews.llvm.org/D103938
More information about the cfe-commits
mailing list