On 12/01/2016 09:15 AM, David Edelsohn wrote:
From the looks of things, it appears we skip them in the dwarf2 code as
well. But I don't think we can use TEMPLATE_DECL here as that's defined
by the C++ front end.
A number of the "variant" testcases fail to build on AIX and targets
that use stabs. The failure looks like:
internal compiler error: tree check: expected field_decl, have
template_decl in int_bit_position, at tree.h:5396
which occurs in dbxout_type_fields()
/* Output the name, type, position (in bits), size (in bits) of each
field that we can support. */
for (tem = TYPE_FIELDS (type); tem; tem = DECL_CHAIN (tem))
if (VAR_P (tem))
stabstr_D (int_bit_position (tem));
stabstr_D (tree_to_uhwi (DECL_SIZE (tem)));
where tem is a TEMPLATE_DECL. The dbxout code currently skips
TYPE_DECL, nameless fields, and CONST_DECL.
dbxout_type_methods() explicitly skips TEMPLATE_DECLs with the comment
"The debugger doesn't know what to do with such entities anyhow", so
this proposed patch skips them in dbxout_type_fields() as well.
* dbxout.c (dbxout_type_fields): Skip TEMPLATE_DECLs.
I think instead if you test something like:
(int)TREE_CODE (decl) > NUM_TREE_CODES
You'll filter out any _DECL nodes coming out of the front-ends.