Bug Report #3

Alexandrescu, Andrei AlexandrescuA@MICROMODELING.COM
Sat Nov 7 23:58:00 GMT 1998


The following erratic code crashes egcs:

/////////////////////////////////////////////////////
template <typename Interface, bool Exists>
class inherit_if {};
template <typename Interface>
	class inherit_if<true> : public Interface {};
/////////////////////////////////////////////////////

The corrected code below compiles correctly, though:

/////////////////////////////////////////////////////
template <typename Interface, bool Exists>
class inherit_if {};
template <typename Interface>
	class inherit_if<Interface, true> : public Interface {};
/////////////////////////////////////////////////////

Yours,

Andrei



More information about the Gcc-bugs mailing list