Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <005d01c143a5$34f7bb80$6501a8c0@dns.rcn.net> Reply-To: "Robert Allan Schwartz" From: "Robert Allan Schwartz" To: Subject: 1.3.3: g++ misinterprets an instantiation of a template class Date: Sat, 22 Sep 2001 16:28:51 -0400 Organization: Tessellation Training MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Here is the test case: #include using namespace std; // general case: template class static_checker; // declaration, not definition. // special case: template <> class static_checker { // definition. }; int main(void) { static_checker sizeof_int_checker; // line 20. static_checker sizeof_char_checker; // line 22. return 0; } I expect an error on line 22, as static_checker is declared but not defined, but instead I get these errors: sample036.cpp: In function `int main()': sample036.cpp:20: `sizeof_int_checker' undeclared (first use this function) sample036.cpp:20: (Each undeclared identifier is reported only once sample036.cpp:20: for each function it appears in.) sample036.cpp:20: parse error before `;' sample036.cpp:22: `sizeof_char_checker' undeclared (first use this function) sample036.cpp:22: parse error before `;' MSVC 6.0 and Metrowerks CodeWarrior 2.0 get this right. Thanks for your help, Robert Schwartz -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/