From stdcxx-dev-return-5011-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Sat Sep 15 20:49:55 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 72082 invoked from network); 15 Sep 2007 20:49:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Sep 2007 20:49:54 -0000 Received: (qmail 51842 invoked by uid 500); 15 Sep 2007 20:49:47 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 51780 invoked by uid 500); 15 Sep 2007 20:49:47 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 51769 invoked by uid 99); 15 Sep 2007 20:49:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Sep 2007 13:49:47 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 209.85.146.180 as permitted sender) Received: from [209.85.146.180] (HELO wa-out-1112.google.com) (209.85.146.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Sep 2007 20:49:43 +0000 Received: by wa-out-1112.google.com with SMTP id n4so3701899wag for ; Sat, 15 Sep 2007 13:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=pgMjirENqz8ygjp9K6FxsSQ71H8L80UMqEaR1ZuwgFo=; b=Q00BwnJYa36hFnLDxbSALm+XhD7zzbl1DThQOOd8yoGCL88iAoCHfPKiYTNXjll/FzR1VIubfKjUs3ydjbcyrJRDbxbZt1Iqvt9kL6O+NiNXkdU3tYR8EYDOH8ZaFVfc2T1MbbJPvkGQqq+CwndUEoVqMNs+qAhKeTB2atOEtKI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=IQ7pVxfM601rGGH2TDma6jn/ME7+qAoV8A4b0ujmUupo4JzDDX1ruQxMfTjTl+YleyhZQPbeuEPtNyr/DM4eoOxteCRiSIBy+9LsqneTZIYEnEnZ0gk21gZFpCDVY78saDTBmb2vXrj8vyQz/SGOQ2bmdbgZSj5EeIrCHkJOR+w= Received: by 10.114.148.1 with SMTP id v1mr1524742wad.1189889362434; Sat, 15 Sep 2007 13:49:22 -0700 (PDT) Received: from ?192.168.1.104? ( [71.229.200.170]) by mx.google.com with ESMTPS id k14sm2427567waf.2007.09.15.13.49.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 15 Sep 2007 13:49:21 -0700 (PDT) Message-ID: <46EC454F.7080303@roguewave.com> Date: Sat, 15 Sep 2007 14:49:19 -0600 From: Martin Sebor Organization: Rogue Wave Software User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20070719 Fedora/1.0.9-2.fc6 pango-text SeaMonkey/1.0.9 MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: svn commit: r573119 - /incubator/stdcxx/trunk/tests/regress/24.operations.stdcxx-234.cpp References: <20070906003014.4D7621A9832@eris.apache.org> <46E87E5E.3070402@roguewave.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Martin Sebor X-Virus-Checked: Checked by ClamAV on apache.org Travis Vitek wrote: > > >> Martin Sebor wrote: >> >> Travis Vitek wrote: >>> >>> >>> It appears that MSVC doesn't like that you haven't provided >>> the template parameter types for the specialization of distance(). >> Looks like a compiler bug. We should report it to Microsoft. >> If you don't have one yet, this might be a good opportunity >> to set up an account with them and learn how to do it :) >> > > Done. http://tinyurl.com/2u7ave. [14.7.3 p10] Good. Of course, they immediately closed it as not reproducible in their internal version with no reference to an existing bug report so we can only hope that they have a regression test for it and/or that it doesn't regress between now and the final release... > >>> It looks like gcc doesn't like how you've put the distance() >>> specialization into namespace std. It appears that this is >>> supposed to be legal [14.7.3 p9], but gcc rejects the code. >> Yes, it's a gcc 3.2 bug. We reported it back in 2002: >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8266 >> > > Well I was compiling with gcc 3.4.6, and your testcase is different from > what we have here. I _believe_ that the gcc testcase you provided is > explicitly instantiating the foo() template on int. That is very > different from the problem I'm describing. > > I don't really think this is a gcc bug [but it is likely to be a msvc > bug]. From the 2003 version of the standard... Are you saying you're disagreeing with me?! ;-) You're right, I misremembered the problem. It's too bad that this syntax is ill-formed for explicit specialization because the same syntax is allowed for explicit instantiation: namespace N { template void foo (T) { } } template void N::foo (int); // okay extern template void N::foo (int); // okay (w/o the above) template <> void N::foo (long) { } // error Martin > > [14.7.3 p2] An explicit specialization shall be declared in the > namespace > of which the template is a member, or, for member templates, [...] Such > a > declaration may also be a definition. If the declaration is not a > definition, the specialization may be defined later (7.3.1.2). > > [7.3.1.2 p2] Members (including explicit specializations of templates > (14.7.3)) of a named namespace can be defined outside that namespace by > explicit qualification (3.4.3.2) of the name being defined, provided > that > the entity being defined was already declared in the namespace and the > declaration appears after the point of declaration in a namespace that > encloses the declaratsion's namespace. [Example: > > namespace Q { > namespace V { > void f(); > } > void V::f() { /*...*/ } // OK > void V::g() { /*...*/ } // error: g() is not yet a member of V > namespace V { > void g(); > } > } > > namespace R { > void Q::V::g() { /*...*/ } // error: R doesn't enclose Q > } > ] > > Travis >