This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11489] [3.4 Regression] ICE/segfault on legal code


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11489



------- Additional Comments From numerical dot simulation at web dot de  2003-07-12 22:47 -------
Subject: Re:  [3.4 Regression] ICE/segfault on legal code

neroden at gcc dot gnu dot org wrote:

> This seems to be the line on which it's failing:
> static_cast<bool>(C::value)

Yup.

> What is this supposed to mean, anyway?

Well, this is meta-programming, the kind of code
You don't like if You build compilers :-)

> C is a *typename*.

Yes.

> I assume 'value' has to be something which is the same for

> all instances of the type?

no, value is a member of the template arg C.
If during instantiation the compiler sees C has no
member named value or member "value" cannot be
converted to bool, then an appropriate error message
will tell the programmer that he is an idiot.
Otherwise the programmer sends in a bug report (11489)

> (How would that be done anyway?)

It's a kind of magic.

> :-/  Is this code even valid?

Yes! :-)
C++ is so much fun.

Markus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]