Commit 50ccdf5b by Jason Merrill Committed by Jason Merrill

re PR c++/68679 (gcc-5.2.1 ICE in C++11 anon union of structs with template fns,…

re PR c++/68679 (gcc-5.2.1 ICE in C++11 anon union of structs with template fns, OK in gcc <= 4.9.3)

	PR c++/68679
	* decl2.c (reset_type_linkage_2): Look through member templates.

From-SVN: r233512
parent f590daa4
2016-02-17 Jason Merrill <jason@redhat.com>
PR c++/68679
* decl2.c (reset_type_linkage_2): Look through member templates.
2016-02-17 Jakub Jelinek <jakub@redhat.com>
PR c++/69850
......
......@@ -2685,14 +2685,22 @@ reset_type_linkage_2 (tree type)
reset_decl_linkage (ti);
}
for (tree m = TYPE_FIELDS (type); m; m = DECL_CHAIN (m))
if (VAR_P (m))
reset_decl_linkage (m);
{
tree mem = STRIP_TEMPLATE (m);
if (VAR_P (mem))
reset_decl_linkage (mem);
}
for (tree m = TYPE_METHODS (type); m; m = DECL_CHAIN (m))
{
reset_decl_linkage (m);
if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (m))
/* Also update its name, for cxx_dwarf_name. */
DECL_NAME (m) = TYPE_IDENTIFIER (type);
tree mem = STRIP_TEMPLATE (m);
reset_decl_linkage (mem);
if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (mem))
{
/* Also update its name, for cxx_dwarf_name. */
DECL_NAME (mem) = TYPE_IDENTIFIER (type);
if (m != mem)
DECL_NAME (m) = TYPE_IDENTIFIER (type);
}
}
binding_table_foreach (CLASSTYPE_NESTED_UTDS (type),
bt_reset_linkage_2, NULL);
......
// PR c++/68679
typedef struct {
struct {
unsigned d[4];
template<typename T>
unsigned operator[] (T i) const { return d[i]; }
} c;
} A;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment