https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104920
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- There is nothing unreliable on the warning. If it sees a memset call with an base language array and size that constant evaluates to the number of array elements and the array element has size > 1, it warns. The warning is implemented in the FEs, so it can't see through functions that would need to be inlined etc., it really requires the size to be constant expression. In some of your testcases, that is the case even when you use std:array, in others it is not.