From 6cf3367c6d3ffb9f640957ab0ddd50667a0780bb Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Sat, 30 Jul 2011 17:27:29 +0000 Subject: [PATCH] Fix invalid assertion of C++ external static data member declarations as anonymous namespaces are local to the current translation. GCC PR: c++/33094 Reviewed by: uqs Approved by: re (kib) Obtained from: gcc (branches/redhat/gcc-4_1-branch, rev. 129554, GPLv2) MFC after: 1 week --- contrib/gcc/cp/ChangeLog | 6 ++++++ contrib/gcc/cp/decl.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/gcc/cp/ChangeLog b/contrib/gcc/cp/ChangeLog index 39875472b86..7cd1fb4d7a8 100644 --- a/contrib/gcc/cp/ChangeLog +++ b/contrib/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-09-29 Jason Merrill + + PR c++/33094 + * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member + constant to not have DECL_EXTERNAL if it's file-local. + 2007-08-24 Jakub Jelinek PR c++/31941 diff --git a/contrib/gcc/cp/decl.c b/contrib/gcc/cp/decl.c index b837b145153..4e3c6e9bc4a 100644 --- a/contrib/gcc/cp/decl.c +++ b/contrib/gcc/cp/decl.c @@ -4968,7 +4968,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) /* 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) - gcc_assert (DECL_EXTERNAL (decl)); + gcc_assert (DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)); } /* We don't create any RTL for local variables. */