https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114983
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:646db3d30bd071a1b671b4f91c9ea2ab7f2be21c commit r15-351-g646db3d30bd071a1b671b4f91c9ea2ab7f2be21c Author: Marek Polacek <pola...@redhat.com> Date: Wed May 8 17:02:49 2024 -0400 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.