Commit 5a5e7deb by Jason Merrill Committed by Jason Merrill

re PR c++/58965 ([c++11] ICE with member initializer in static union)

	PR c++/58965
	* mangle.c (write_guarded_var_name): Handle null DECL_NAME.

From-SVN: r206405
parent 62dd455c
2014-01-07 Jason Merrill <jason@redhat.com>
PR c++/58965
* mangle.c (write_guarded_var_name): Handle null DECL_NAME.
2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
* semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
......
......@@ -3775,7 +3775,8 @@ mangle_conv_op_name_for_type (const tree type)
static void
write_guarded_var_name (const tree variable)
{
if (strncmp (IDENTIFIER_POINTER (DECL_NAME (variable)), "_ZGR", 4) == 0)
if (DECL_NAME (variable)
&& strncmp (IDENTIFIER_POINTER (DECL_NAME (variable)), "_ZGR", 4) == 0)
/* The name of a guard variable for a reference temporary should refer
to the reference, not the temporary. */
write_string (IDENTIFIER_POINTER (DECL_NAME (variable)) + 4);
......
// PR c++/58965
// { dg-require-effective-target c++11 }
void foo()
{
static union
{
int i = i;
};
}
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