PR c++/34094
* decl2.c (cp_write_global_declarations): Don't write out static
data members with DECL_IN_AGGR_P set.
From-SVN: r132218
+2008-02-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/34094
+ * decl2.c (cp_write_global_declarations): Don't write out static
+ data members with DECL_IN_AGGR_P set.
+
2008-02-08 Jason Merrill <jason@redhat.com>
PR c++/35116
/* Static data members are just like namespace-scope globals. */
for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i)
{
- if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl))
+ if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl)
+ /* Don't write it out if we haven't seen a definition. */
+ || DECL_IN_AGGR_P (decl))
continue;
import_export_decl (decl);
/* If this static data member is needed, provide it to the
--- /dev/null
+// PR c++/34094
+// { dg-do link }
+// { dg-options "-g" }
+
+namespace {
+ struct c
+ {
+ static const bool t = 0;
+ };
+}
+
+const bool &f()
+{
+ return c::t; // { dg-error "undefined" }
+}
+
+int main(void)
+{
+ return 0;
+}
+