Message ID | 20160108201643.GO31604@redhat.com |
---|---|
State | New |
Headers | show |
OK. Jason
diff --git gcc/cp/decl2.c gcc/cp/decl2.c index 9a07e1e..a7212ca0 100644 --- gcc/cp/decl2.c +++ gcc/cp/decl2.c @@ -1820,7 +1820,8 @@ comdat_linkage (tree decl) } } - DECL_COMDAT (decl) = 1; + if (TREE_PUBLIC (decl)) + DECL_COMDAT (decl) = 1; } /* For win32 we also want to put explicit instantiations in diff --git gcc/testsuite/g++.dg/pr69113.C gcc/testsuite/g++.dg/pr69113.C index e69de29..2f8331e 100644 --- gcc/testsuite/g++.dg/pr69113.C +++ gcc/testsuite/g++.dg/pr69113.C @@ -0,0 +1,17 @@ +// PR c++/69113 +// { dg-do compile } +// { dg-options "-fno-weak" } + +struct foo +{ + static void bar () + { + struct baz + { + static void m () + { + static int n; + } + }; + } +};