[llvm-commits] [llvm-gcc-4.2] r57711 - /llvm-gcc-4.2/trunk/gcc/cp/decl.c

Dale Johannesen dalej at apple.com
Fri Oct 17 11:19:47 PDT 2008


Author: johannes
Date: Fri Oct 17 13:19:47 2008
New Revision: 57711

URL: http://llvm.org/viewvc/llvm-project?rev=57711&view=rev
Log:
Bring over fix for PR 2661 from Apple gcc.
Fix by Mike Stump.


Modified:
    llvm-gcc-4.2/trunk/gcc/cp/decl.c

Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=57711&r1=57710&r2=57711&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Fri Oct 17 13:19:47 2008
@@ -5151,10 +5151,15 @@
   if (DECL_LANG_SPECIFIC (decl) && DECL_IN_AGGR_P (decl))
     {
       gcc_assert (TREE_STATIC (decl));
+      /* APPLE LOCAL begin templated static data 6298605 */
       /* An in-class declaration of a static data member should be
-	 external; it is only a declaration, and not a definition.  */
-      if (init == NULL_TREE)
+	 external if the decl is accessible from outside this
+	 translation unit (eg something not in an anonymous
+	 namespace); it is only a declaration, and not a
+	 definition.  */
+      if (init == NULL_TREE && TREE_PUBLIC (decl))
 	gcc_assert (DECL_EXTERNAL (decl));
+      /* APPLE LOCAL end templated static data 6298605 */
     }
 
   /* We don't create any RTL for local variables.  */





More information about the llvm-commits mailing list