This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ Patch] PR 56534
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Tue, 05 Mar 2013 18:21:37 +0100
- Subject: [C++ Patch] PR 56534
Hi,
this (and 55786, which is a Dup) is an ICE on invalid regression in
4.7/4.8. The problem is that for such broken input,
check_elaborated_type_specifier is called by
cp_parser_elaborated_type_specifier with a DECL which has a nul
TREE_TYPE, a TEMPLATE_ID_EXPR actually, and therefore immediately
crashes on TREE_CODE (type) == TEMPLATE_TYPE_PARM.
In comparison, 4_6-branch, instead of calling
check_elaborated_type_specifier, has cp_parser_elaborated_type_specifier
simply doing type = TREE_TYPE (decl), thus it seems we can cure the
regression in a straightforward and safe way by simply checking that
TREE_TYPE (decl) is not nul at the beginning of
check_elaborated_type_specifier. In this way the error messages are also
exactly the same produced by 4_6.
Tested x86_64-linux.
Thanks,
Paolo.
//////////////////////
Attachment:
CL_56534
Description: Text document
Attachment:
patch_56534
Description: Text document