From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27024 invoked by alias); 20 Sep 2004 04:27:46 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 27002 invoked from network); 20 Sep 2004 04:27:44 -0000 Received: from unknown (HELO simmts7-srv.bellnexxia.net) (206.47.199.165) by sourceware.org with SMTP; 20 Sep 2004 04:27:44 -0000 Received: from Toronto-HSE-ppp3657351.sympatico.ca ([65.95.132.42]) by simmts7-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20040920042523.JPKE1960.simmts7-srv.bellnexxia.net@Toronto-HSE-ppp3657351.sympatico.ca> for ; Mon, 20 Sep 2004 00:25:23 -0400 From: Tyson Whitehead Reply-To: twhitehe@uwo.ca To: gcc@gcc.gnu.org Subject: Template Template Matching Problem on Defaults (old g++ extension induced problem -- bug 9737) Date: Mon, 20 Sep 2004 07:14:00 -0000 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200409200040.03005.twhitehe@uwo.ca> X-SW-Source: 2004-09/txt/msg01153.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 At some point in time an extension was added to g++ in order to make a template template specialization for n parameters match a template with n+m parameters, when the extra m parameters have default values. This cause the undesirable side effect of breaking the breaking the following (valid) code (I verified this with g++ 3.3-3.5): - --- template struct match { }; template class t_,typename T_> struct match > { typedef int type; }; template class t_,typename T0_,typename T1_> struct match > { typedef int type; }; template struct other { }; typedef match >::type type; Bug.cpp:9: error: ambiguous class template instantiation for `struct match >' Bug.cpp:5: error: candidates are: struct match > Bug.cpp:3: error: struct match > - --- A patch to make the compiler compliant with regards to this issue was provided in April 2003. The bug was suspended, with out the patching be applied/extension being removed, due to possible changes in the next C++ standard. Anyone have an update for September 2004? Is it not part of the standard (finger's crossed)? Can we remove/depreciate this extension (as seemed to be the conclusion reached on the mailing list discussion around the submitted patch -- http://gcc.gnu.org/ml/gcc-patches/2003-04/msg01410.html) so I can compile my code (or at least make the g++ specific matching extension bind less tightly than what C++ standard choice). - -T PS: I also don't get what analogue this extension was suppose to maintain with function function parameters (see bug report). I just finished checking, and g++ certainly does not allow things like assigning an n (non default) plus m (default) argument function to an n argument function pointer. - -- Tyson Whitehead (-twhitehe@uwo.ca -- WSC-) Computer Engineer Dept. of Applied Mathematics, Graduate Student- Applied Mathematics University of Western Ontario, GnuPG Key ID# 0x8A2AB5D8 London, Ontario, Canada -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBTl8iRXbLmIoqtdgRAiRvAKDdkAdi9hdT6RJ6dBXJ4LNUVrWAhACdEQaY RylQmYDmi9efOwOMazvIczs= =nrGH -----END PGP SIGNATURE-----