This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34774] [4.1/4.2/4.3 Regression] templates, enumerations, overflow, ice
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jan 2008 09:23:44 -0000
- Subject: [Bug c++/34774] [4.1/4.2/4.3 Regression] templates, enumerations, overflow, ice
- References: <bug-34774-9709@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #15 from rguenther at suse dot de 2008-01-16 09:23 -------
Subject: Re: [4.1/4.2/4.3 Regression] templates, enumerations,
overflow, ice
On Tue, 15 Jan 2008, tbptbp at gmail dot com wrote:
> ------- Comment #14 from tbptbp at gmail dot com 2008-01-15 20:07 -------
> I keep bumping into this issue and i'd really appreciate a clue about how to
> workaround for the time being.
As of the analysis, try to avoid non-dependent enum members that
double- (or more) -indirectly depends on a dependent enum member.
For example by propagating the value manually.
Like instead of
template <int i>
struct foo {
enum { a = i, b = a+1, c = b+2 }
do
enum { a = i, b = i+1, c = i+3 }
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34774