From dev-return-8316-apmail-stdcxx-dev-archive=stdcxx.apache.org@stdcxx.apache.org Tue Oct 14 02:39:08 2008 Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 74978 invoked from network); 14 Oct 2008 02:39:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Oct 2008 02:39:08 -0000 Received: (qmail 35310 invoked by uid 500); 14 Oct 2008 02:39:09 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 35281 invoked by uid 500); 14 Oct 2008 02:39:09 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 35270 invoked by uid 99); 14 Oct 2008 02:39:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 19:39:08 -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.198.230 as permitted sender) Received: from [209.85.198.230] (HELO rv-out-0506.google.com) (209.85.198.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Oct 2008 02:38:02 +0000 Received: by rv-out-0506.google.com with SMTP id g37so2253084rvb.23 for ; Mon, 13 Oct 2008 19:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=+9IWk8YIdqCLBrfEaEnapyvNofUj6OAaYYt1qvZwCUY=; b=mui0dfwyy80f7Zxe6giQCj5LhZQrcI21+B8AXRCQatm6M65I/qY2B08FT01xjgD+cb yBWOy7WfUdU5Qg412Gu67unWjm7ymyMvthg3JVHwEeglJ+3wvYrxqzMpT9BaXxotdyVS +2NiLb0Pdmqy3WCTZibASnfWZ3RWZeMQ3UEWs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=c5FmnWr4BN3YfVkO58CNwxmr4lY+hDUycPfQqKW3EujvKKtvwv59HB6kmxZO3wOOvI M+k1545fGrQU8/2UUuXM/36LTH3PYqHYrRJR5WYHpb8BJtt3kDZkaNOFsi7SXiqxAWeg KfeYHOAOdSti1XbxT7h3sGclpWXEyT+5jLM2M= Received: by 10.141.89.13 with SMTP id r13mr4406520rvl.88.1223951919200; Mon, 13 Oct 2008 19:38:39 -0700 (PDT) Received: from bugsy.net (c-71-229-200-170.hsd1.co.comcast.net [71.229.200.170]) by mx.google.com with ESMTPS id c20sm15191699rvf.3.2008.10.13.19.38.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 13 Oct 2008 19:38:37 -0700 (PDT) Message-ID: <48F4062A.7030006@gmail.com> Date: Mon, 13 Oct 2008 20:38:34 -0600 From: Martin Sebor User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: [HP aCC 3.xx on HP-UX/PA-RISC] 20.specialized test fails to compile References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Farid Zaripov wrote: > The 20.specialized test fails to compile after change in http://svn.apache.org/viewvc?view=rev&revision=697885 > > -------- > aCC -c -D_RWSTDDEBUG -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -I$(TOPDIR)/tests/include -AA -g +d +DD64 +w +W392,655,684,818,819,849 $(TOPDIR)/tests/utilities/20.specialized.cpp > Error 746: "$(TOPDIR)/include/rw/_specialized.h", line 175 # Cannot use static_cast to convert struct FwdIter to volatile void *. > _RWSTD_STATIC_CAST (volatile void*, &*__res); > ^^^^^^^^^^^^^^^^^^ > Error 556: "$(TOPDIR)/tests/utilities/20.specialized.cpp", line 140 # Unable to generate specialization "FwdIter std::uninitialized_copy,FwdIter >(InputIter,InputIter,FwdIter)" due to errors during generation. > std::uninitialized_copy (first, last, result); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Error 556: "$(TOPDIR)/tests/utilities/20.specialized.cpp", line 140 # Unable to generate specialization "FwdIter std::uninitialized_copy,FwdIter >(InputIter,InputIter,FwdIter)" due to errors during generation. > std::uninitialized_copy (first, last, result); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > gmake: *** [20.specialized.o] Error 2 > -------- > > On the other compilers/platforms this test compiled without errors. > > Can anyone to look into this issue? It's the const qualifier on __ptr that's causing the trouble (see the test case below). This patch fixes for me: Index: include/rw/_specialized.h =================================================================== --- include/rw/_specialized.h (revision 704292) +++ include/rw/_specialized.h (working copy) @@ -171,7 +171,8 @@ _TRY { for (; __first != __last; ++__first, ++__res) { - volatile void* const __ptr = + // avoid const-qualifying ptr to prevent an HP aCC 3 bug + volatile void* /* const */ __ptr = _RWSTD_STATIC_CAST (volatile void*, &*__res); ::new (_RWSTD_CONST_CAST (void*, __ptr)) _TypeT (*__first); } I haven't tested it except with aCC but it seems safe enough to commit if you're happy with it. What a pain this bug, huh? Martin $ cat z.cpp && aCC -V z.cpp struct S { int *x; int& operator* () const { return *x; } }; template void foo (T x) { volatile void* const p = static_cast(&*x); } int main () { foo (S ()); } aCC: HP ANSI C++ B3910B A.03.73 Error 746: "z.cpp", line 7 # Cannot use static_cast to convert struct S to volatile void *. volatile void* const p = static_cast(&*x); ^ Error 556: "z.cpp", line 11 # Unable to generate specialization "void foo(S)" due to errors during generation. foo (S ()); ^^^^^^^^^^ Error 556: "z.cpp", line 11 # Unable to generate specialization "void foo(S)" due to errors during generation. foo (S ()); ^^^^^^^^^^