commit 0d626f236f9daf2891362c17db1220214ab0a64d
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jan 2 22:50:11 2014 -0500
PR c++/58965
* mangle.c (write_guarded_var_name): Handle null DECL_NAME.
@@ -3778,7 +3778,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);
new file mode 100644
@@ -0,0 +1,10 @@
+// PR c++/58965
+// { dg-require-effective-target c++11 }
+
+void foo()
+{
+ static union
+ {
+ int i = i;
+ };
+}