This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33094] [4.2/4.3 Regression] ICE on valid C++ virtual template static member in anonymous namespace
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Aug 2007 14:31:26 -0000
- Subject: [Bug c++/33094] [4.2/4.3 Regression] ICE on valid C++ virtual template static member in anonymous namespace
- References: <bug-33094-1313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from ian at airs dot com 2007-08-17 14:31 -------
This patch fixes the problem and passes the g++ testsuite.
Index: cp/decl.c
===================================================================
--- cp/decl.c (revision 127491)
+++ cp/decl.c (working copy)
@@ -4963,7 +4963,7 @@ make_rtl_for_nonlocal_decl (tree decl, t
gcc_assert (TREE_STATIC (decl));
/* 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)
+ if (init == NULL_TREE && DECL_INITIAL (decl) == NULL_TREE)
gcc_assert (DECL_EXTERNAL (decl));
}
--
ian at airs dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.2 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33094