<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>template code not accepted by GCC 3.0.4</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Hi,</FONT>
</P>

<P><FONT SIZE=2>My girlfriend has some code that used to compile with GCC 2.95, but</FONT>
<BR><FONT SIZE=2>received a report from a GCC 3.0.4 user that some code does not</FONT>
<BR><FONT SIZE=2>compile. This is a typedef of a specialization of std::set.</FONT>
<BR><FONT SIZE=2>Since we can't upgrade to GCC 3.0.4 at home (I don't want to mess</FONT>
<BR><FONT SIZE=2>my Linux box, and have not enough disk space atm, and last time I</FONT>
<BR><FONT SIZE=2>tried to upgrade to 2.95.3, nasty things happened (though I managed</FONT>
<BR><FONT SIZE=2>to recover the trouble)), and that the latest cygwin version still</FONT>
<BR><FONT SIZE=2>sports 2.95.3 for win2k box at work, we can't test anything.</FONT>
</P>

<P><FONT SIZE=2>This is some code that feature the faulty lines, in hope that it</FONT>
<BR><FONT SIZE=2>actually fails to compile with 3.0.4. It does compile with 2.95.</FONT>
<BR><FONT SIZE=2>I'd appreciate if someone could point out what actually is wrong.</FONT>
<BR><FONT SIZE=2>Before you say that, yes, I do know that it misses a using namespace</FONT>
<BR><FONT SIZE=2>STL declaration (we found that GCC oddly doesn't honor the std</FONT>
<BR><FONT SIZE=2>namespace by default, probably for backward compatibility reasons),</FONT>
<BR><FONT SIZE=2>but fully qualifying std::set does not help.</FONT>
</P>

<P><FONT SIZE=2>The error messages reported by the GCC 3.0.4 user were, depending</FONT>
<BR><FONT SIZE=2>on some variations my girlfriend asked him to make:</FONT>
</P>

<P><FONT SIZE=2>(non verbatim):</FONT>
<BR><FONT SIZE=2>ISO standard forbids to declare 'set' without type</FONT>
<BR><FONT SIZE=2>template-id 'set&lt;Place&gt;' can't be used as a declarator</FONT>
</P>

<P><FONT SIZE=2>and (verbatim):</FONT>
<BR><FONT SIZE=2>src/selected.h:31: `set' is not a template</FONT>
<BR><FONT SIZE=2>src/selected.h:31: ISO C++ forbids declaration of `set2d' with no type</FONT>
</P>

<P><FONT SIZE=2>This is the actual snippet. The original code can be found in the</FONT>
<BR><FONT SIZE=2>eme package at <A HREF="http://annie.kezako.net/eme/" TARGET="_blank">http://annie.kezako.net/eme/</A></FONT>
</P>

<P><FONT SIZE=2>#include &lt;set&gt;</FONT>
</P>

<P><FONT SIZE=2>class C {</FONT>
<BR><FONT SIZE=2>};</FONT>
</P>

<P><FONT SIZE=2>class A {</FONT>
<BR><FONT SIZE=2>&nbsp; typedef set&lt;C&gt; my_set;</FONT>
<BR><FONT SIZE=2>};</FONT>
</P>

<P><FONT SIZE=2>int main()</FONT>
<BR><FONT SIZE=2>{</FONT>
<BR><FONT SIZE=2>&nbsp; return 0;</FONT>
<BR><FONT SIZE=2>}</FONT>
</P>

<P><FONT SIZE=2>Thanks,</FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Vincent Penquerc'h </FONT>
</P>

</BODY>
</HTML>