]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/57551
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jun 2013 14:23:24 +0000 (14:23 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jun 2013 14:23:24 +0000 (14:23 +0000)
* g++.dg/ext/visibility/anon6.C: Update testcase.
* cp/pt.c (mark_decl_instantiated): Do not export explicit instantiations
of anonymous namespace templates.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199956 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/visibility/anon6.C

index 02451538a988f556178dc2775c05ee75dcb0d200..144f1fc4edb205b65b51629d38a2edbe70f22de2 100644 (file)
@@ -1,3 +1,9 @@
+2013-06-11  Jan Hubicka  <jh@suse.cz>
+
+       PR c++/57551
+       * cp/pt.c (mark_decl_instantiated): Do not export explicit instantiations
+       of anonymous namespace templates.
+
 2013-06-10  Jason Merrill  <jason@redhat.com>
 
        * name-lookup.c (add_decl_to_level): Add decls in an anonymous
index 5d83cc6c967bd674c49db56cbeb49b7a9bbf7f74..3602fcd2dd8fadc60095f152143dcaef9ae809f1 100644 (file)
@@ -17399,6 +17399,13 @@ mark_decl_instantiated (tree result, int extern_p)
   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.  */
index 611404da34fca269d79416484d21906e89ffc9a8..f3bcb95c36accd238c5fc6207711388a78a04f8b 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-11  Jan Hubicka  <jh@suse.cz>
+
+       PR c++/57551
+       * g++.dg/ext/visibility/anon6.C: Update testcase.
+
 2013-06-10  Balaji V. Iyer  <balaji.v.iyer@intel.com>
 
        PR c/57563
index 951de4964e4fa4bbd6c8b48e2b0afe1415f5491c..c0aa73577933f3f4889ee56400fef55ba72bf906 100644 (file)
@@ -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;