https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96120
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Haoxin Tu from comment #3) > Apologize for my expression. I mean the meaning of the error message > "invalid use of type ‘void’ in parameter declaration" is opposite with the > valid grammar(it should be allowed in the first parameter). No, it's not the opposite at all. void is only allowed when there is a single, unnamed non-dependent parameter of type void. Any other use is void is invalid, including the case where you have (void, int). And so GCC's error message is absolutely correct. Using void in a parameter list with more than one parameter is invalid.