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
This commit is contained in:
Martin Matuska 2011-07-30 17:27:29 +00:00
parent 339772b003
commit 6cf3367c6d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=224523
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-09-29 Jason Merrill <jason@redhat.com>
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 <jakub@redhat.com>
PR c++/31941

View File

@ -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. */