https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100482
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:a90bd3ea6d1ba27b15476f0a768d7952c6723420 commit r14-3087-ga90bd3ea6d1ba27b15476f0a768d7952c6723420 Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Tue Aug 8 12:48:43 2023 +1000 c++: Report invalid id-expression in decltype [PR100482] This patch ensures that any errors raised by finish_id_expression when parsing a decltype expression are properly reported, rather than potentially going ignored and causing invalid code to be accepted. We can also now remove the separate check for templates without args as this is also checked for in finish_id_expression. PR c++/100482 gcc/cp/ChangeLog: * parser.cc (cp_parser_decltype_expr): Report errors raised by finish_id_expression. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/decltype-100482.C: New test. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>