rsmith added a comment.
I've given this some more thought, and I think it's only the "constant
evaluated" check that we want to bypass in this case. It's common to use
`sizeof` or `decltype` with a comma operator in order to put an expression in a
SFINAE context, and I don't think we should warn on those cases. So I think we
should still do the context check for `DiagIfReachable`, but only bail out for
unevaluated contexts, not for constant-evaluated contexts. Does that seem
reasonable?
================
Comment at: clang/test/SemaCXX/warn-unused-value.cpp:147
+ new double[false ? (1, 2) : 3]
+ [false ? (1, 2) : 3]; // expected-warning {{expression result
unused}}
+}
----------------
Please add a FIXME saying that we shouldn't diagnose the unreachable constant
expression here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103938/new/
https://reviews.llvm.org/D103938
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits