https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96258
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathan Sidwell <nat...@gcc.gnu.org>: https://gcc.gnu.org/g:a16da48bf19bb139e5461e5b5b7f072d5369b054 commit r11-4014-ga16da48bf19bb139e5461e5b5b7f072d5369b054 Author: Nathan Sidwell <nat...@acm.org> Date: Fri Oct 16 09:22:22 2020 -0700 c++: Fix null deref at EOF [PR96258] cp_parser_declaration peeks at 1 or 2 tokens, when I changed it not to peek past EOF, I set the second token to NULL. But there are paths through the function that just look at the second token. Fixed by setting that token to EOF rather than NULL in this case. PR c++/96258 gcc/cp/ * parser.c (cp_parser_declaration): Make token2 point to EOF if token1 was EOF. gcc/testsuite/ * g++.dg/parse/pr96258.C: New.