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
This commit is contained in:
parent
62dd455c2e
commit
5a5e7deb5f
|
@ -1,3 +1,8 @@
|
|||
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);
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
// PR c++/58965
|
||||
// { dg-require-effective-target c++11 }
|
||||
|
||||
void foo()
|
||||
{
|
||||
static union
|
||||
{
|
||||
int i = i;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue