===================================================================
@@ -17402,6 +17402,13 @@ mark_decl_instantiated (tree result, int
if (TREE_ASM_WRITTEN (result))
return;
+ /* For anonymous namespace we don't need to do anything. */
+ if (decl_anon_ns_mem_p (result))
+ {
+ gcc_assert (!TREE_PUBLIC (result));
+ return;
+ }
+
if (TREE_CODE (result) != FUNCTION_DECL)
/* The TREE_PUBLIC flag for function declarations will have been
set correctly by tsubst. */
===================================================================
@@ -1,6 +1,8 @@
// PR c++/33094
// { dg-final { scan-assembler "1BIiE1cE" } }
// { dg-final { scan-assembler-not "globl.*1BIiE1cE" } }
+// { dg-final { scan-assembler-not "comdat" } }
+// { dg-final { scan-assembler-not "weak" } }
// { dg-final { scan-assembler-not "1CIiE1cE" } }
// Test that B<int>::c is emitted as an internal symbol, and C<int>::c is
@@ -18,7 +20,7 @@ namespace
template <typename T>
class B
{
- static const T c = 0;
+ __attribute__ ((__used__)) static const T c = 0;
};
template <typename T> const T B<T>::c;