Your message dated Mon, 17 Nov 2003 11:34:48 +0100 with message-id <[EMAIL PROTECTED]> has caused the Debian Bug report #216234, regarding g++-3.3: template function triggers syntax error to be marked as having been forwarded to the upstream software author(s) [EMAIL PROTECTED]
(NB: If you are a system administrator and have no idea what I am talking about this indicates a serious mail system misconfiguration somewhere. Please contact me immediately.) Debian bug tracking system administrator (administrator, Debian Bugs database) --------------------------------------- Received: (at 216234-forwarded) by bugs.debian.org; 17 Nov 2003 10:34:52 +0000 >From [EMAIL PROTECTED] Mon Nov 17 04:34:51 2003 Return-path: <[EMAIL PROTECTED]> Received: from relay2.uni-heidelberg.de [129.206.210.211] by master.debian.org with esmtp (Exim 3.35 1 (Debian)) id 1ALgiZ-0006cO-00; Mon, 17 Nov 2003 04:34:51 -0600 Received: from mail.iwr.uni-heidelberg.de (mail.iwr.uni-heidelberg.de [129.206.104.30]) by relay2.uni-heidelberg.de (8.12.10/8.12.10) with ESMTP id hAHAYnsR008897; Mon, 17 Nov 2003 11:34:49 +0100 (MET) Received: from hal.iwr.uni-heidelberg.de ([EMAIL PROTECTED] [129.206.69.248]) by mail.iwr.uni-heidelberg.de (8.12.10/8.12.9) with ESMTP id hAHAYmfK010647; Mon, 17 Nov 2003 11:34:48 +0100 (MET) Received: from thimo by hal.iwr.uni-heidelberg.de with local (Exim 3.35 #1 (Debian)) id 1ALgiW-0001yl-00; Mon, 17 Nov 2003 11:34:48 +0100 Date: Mon, 17 Nov 2003 11:34:48 +0100 From: Thimo Neubauer <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], Matthias Klose <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: Bug when parsing template-functions? Message-ID: <[EMAIL PROTECTED]> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i Sender: Thimo Neubauer <[EMAIL PROTECTED]> Delivered-To: [EMAIL PROTECTED] X-Spam-Status: No, hits=0.0 required=4.0 tests=none version=2.53-bugs.debian.org_2003_11_15 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_11_15 (1.174.2.15-2003-03-30-exp) Hello, The following code shows that g++ reports a syntax error if the method-call is inside a template-function but not if it's inside a normal function: -- snip -- #include <iostream> template <int dim> class Entity { public: template <class T> void print(T& bla) { std::cout << bla;}; template <int i> int test() { return i; } int other() { return 1; } }; void foo1() { Entity<1> e; // everything works e.other(); e.print("test"); e.test<1>(); }; template <int dim> void foo2() { Entity<dim> e; // works like above e.other(); e.print("test"); // fails with syntax error e.test<1>(); }; int main () { }; -- snip -- riff /tmp> g++ -Wall temptest2.cc temptest2.cc: In function `void foo2()': temptest2.cc:33: error: syntax error before `)' token riff /tmp> g++ --version g++ (GCC) 3.3.2 (Debian) ... (some comments on this may be found in my report to the Debian-BTS on http://bugs.debian.org/216234). I'd like to forward this bug to the GCC-bug-tracking-system but am not sure if this may be the known bug -- snip -- Two stage lookup in templates is not implemented. [14.6] specifies how names are looked up inside a template. G++ does not do this correctly, but for most templates this will not be noticeable. -- snip -- mentioned on http://gcc.gnu.org/bugs.html#known Please CC me on reply, I'm not subscribed to this list. Cheers Thimo