diff options
author | Marek Polacek <polacek@redhat.com> | 2024-05-08 17:02:49 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2024-05-09 15:25:06 -0400 |
commit | 646db3d30bd071a1b671b4f91c9ea2ab7f2be21c (patch) | |
tree | f34b59a7cbc524be0c68f64d914ea9897b21b8d0 /gcc/value-range.cc | |
parent | e02b5683e77c2b4317b23be72e43b6e6cc6c8e5b (diff) | |
download | gcc-646db3d30bd071a1b671b4f91c9ea2ab7f2be21c.zip gcc-646db3d30bd071a1b671b4f91c9ea2ab7f2be21c.tar.gz gcc-646db3d30bd071a1b671b4f91c9ea2ab7f2be21c.tar.bz2 |
c++: failure to suppress -Wsizeof-array-div in template [PR114983]
-Wsizeof-array-div offers a way to suppress the warning by wrapping
the second operand of the division in parens:
sizeof (samplesBuffer) / (sizeof(unsigned char))
but this doesn't work in a template, because we fail to propagate
the suppression bits. Do it, then.
The finish_parenthesized_expr hunk is not needed because suppress_warning
isn't very fine-grained. But I think it makes sense to be explicit and
not rely on OPT_Wparentheses also suppressing OPT_Wsizeof_array_div.
PR c++/114983
gcc/cp/ChangeLog:
* pt.cc (tsubst_expr) <case SIZEOF_EXPR>: Use copy_warning.
* semantics.cc (finish_parenthesized_expr): Also suppress
-Wsizeof-array-div.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wsizeof-array-div3.C: New test.
Diffstat (limited to 'gcc/value-range.cc')
0 files changed, 0 insertions, 0 deletions