[C++ PATCH] decls with error_node type
Nathan Sidwell
nathan@acm.org
Fri May 31 17:57:00 GMT 2019
I discovered we could occasionally create TYPE_DECLs with
error_mark_node type, and then successfully push them into the symbol table!
I don't think we should be doing this -- it means TREE_TYPE of a
TYPE_DECL might not be a type, with resulting ICE fallout. (When we
cons up a VAR_DECL to cope with an undefined lookup we give it int type,
to avoid this kind of thing.)
This patch stops grokdeclarator doing this, by immediately returning
error_mark_node. And added an assert to push_template_decl_real, where
I noticed the problem occurring.
The fallout is some error cascade on symbol lookups that now fail.
error33.C was particularly screwy:
typedef void (A::T) ();
would pushing a T into the current scope.
Jason, ok?
nathan
--
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: terror.diff
Type: text/x-patch
Size: 3494 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190531/c7676dbf/attachment.bin>
More information about the Gcc-patches
mailing list