From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20439 invoked by alias); 16 Nov 2002 05:26:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 20423 invoked by uid 71); 16 Nov 2002 05:26:03 -0000 Date: Fri, 22 Nov 2002 05:11:00 -0000 Message-ID: <20021116052603.20421.qmail@sources.redhat.com> To: paolo@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Pete Ratzlaff Subject: Re: libstdc++/5133: Problems with toupper Reply-To: Pete Ratzlaff X-SW-Source: 2002-11/txt/msg00816.txt.bz2 List-Id: The following reply was made to PR libstdc++/5133; it has been noted by GNATS. From: Pete Ratzlaff To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Cc: paolo@gcc.gnu.org, schmid@snake.iap.physik.tu-darmstadt.de Subject: Re: libstdc++/5133: Problems with toupper Date: Sat, 16 Nov 2002 00:17:10 -0500 I realize this PR is closed, but don't agree with the conclusion that mixing linkages in this case is ill-formed. There's is nothing to preclude the template argument from being a function with C linkage. Here is what the standard has to say: template OutputIterator transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op); 1- Effects: Assigns through every iterator i in the range [result, result + (last1 - first1)) a new corresponding value equal to op(*(first1 + (i - result)) In other words, anything that can have an () appended and follows the rules for template parameters is fair game for the 3rd template argument in this case. All I can guess is that Martin was thinking of the std::ptr_fun and std::pointer_to_unary_function templates, whose argument (and ctor) are explicitly pointers to function (with C++ linkage). I cannot see anything that keeps one from using the toupper/tolower from with transform, and the fact that gcc won't allow it should be considered a bug. Although it certainly doesn't prove my point, I would just note that Comeau's compiler seems to concur. Cheers, -Pete