{"id":2226696,"url":"http://patchwork.ozlabs.org/api/patches/2226696/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhuofit7i2.gcc.gcc-TEST.peppe.53.1.1@forge-stage.sourceware.org/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<bmm.hhuofit7i2.gcc.gcc-TEST.peppe.53.1.1@forge-stage.sourceware.org>","list_archive_url":null,"date":"2026-04-22T18:23:56","name":"[v1,1/1] libstdc++: do not use an unreserved name in _Temporary_buffer [PR119496]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"d4bebe85dceb5e0c9a2121d0ca91c4efeb7affe4","submitter":{"id":93222,"url":"http://patchwork.ozlabs.org/api/people/93222/?format=json","name":"peppe via Sourceware Forge","email":"forge-bot+peppe@forge-stage.sourceware.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhuofit7i2.gcc.gcc-TEST.peppe.53.1.1@forge-stage.sourceware.org/mbox/","series":[{"id":501076,"url":"http://patchwork.ozlabs.org/api/series/501076/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=501076","date":"2026-04-22T18:23:56","name":"WIP: libstdc++: do not use an unreserved name in _Temporary_buffer [PR119496]","version":1,"mbox":"http://patchwork.ozlabs.org/series/501076/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226696/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226696/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g17FB1rcMz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 04:35:10 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 445E242D1F58\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 18:35:08 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 12BD043E2154\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:24:48 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id D7EF64345E\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:24:47 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 445E242D1F58","OpenDKIM Filter v2.11.0 sourceware.org 12BD043E2154"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 12BD043E2154","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 12BD043E2154","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776882288; cv=none;\n b=SgeLzJJmPTka406GoLtfGGRKrcCXHt/prRmX+UqxhgmGKbceADkUcj5OMTWuuMWhnimADVNWw37tTTzPzNYnHpEIVc5QvAvTSpKiVeRhCTbAeiO2YCsZyYFDH3BbMQGukZaoZuVbhbizdB3fq4JUDqzoM52RfCAyhCJXhfQNFWk=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776882288; c=relaxed/simple;\n bh=+W81o0awx5yHhVYWMy6tQckpjWGZLovm4sj0PRa0AFg=;\n h=From:Date:Subject:To:Message-ID;\n b=f5Uf37V0mkFeL2Sg+Wfn1heildt5Ce6KNcDHpgGlWHLvwU67y8tvUnRqH76wQNzEhCHzWlJW/LVUrJLvSEAzzZWqRgppZsccSqf4Lflt8cQuAIGGLqkv5Sa4Gzuc851KCke6cVunX9xpdFdS4fzWvJp82cSNMecOGMXA0A5oZ8g=","ARC-Authentication-Results":"i=1; server2.sourceware.org","From":"peppe via Sourceware Forge <forge-bot+peppe@forge-stage.sourceware.org>","Date":"Wed, 22 Apr 2026 18:23:56 +0000","Subject":"[PATCH v1 1/1] libstdc++: do not use an unreserved name in\n _Temporary_buffer [PR119496]","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Message-ID":"\n <bmm.hhuofit7i2.gcc.gcc-TEST.peppe.53.1.1@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/53","References":"\n <bmm.hhuofit7i2.gcc.gcc-TEST.peppe.53.1.0@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuofit7i2.gcc.gcc-TEST.peppe.53.1.0@forge-stage.sourceware.org>","X-Patch-URL":"\n https://forge.sourceware.org/peppe/gcc-TEST/commit/42269a3d46b3f031cf5f56826dce2650f45e7689","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Reply-To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>,\n peppe@noreply.localhost","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"From: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>\n\nAs the PR observes, _Temporary_buffer was using an unreserved name for a\nmember function that can therefore clash with macros defined by the\nuser. Avoid that by renaming the member function.\n\n\tPR libstdc++/119496\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/bits/stl_algo.h: Adjust calls to requested_size.\n\t* include/bits/stl_tempbuf.h (requested_size): Rename with\n\tan _M_ prefix.\n\t* testsuite/17_intro/names.cc: Add a #define for\n\trequested_size.\n\nSigned-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>\n---\n libstdc++-v3/include/bits/stl_algo.h     | 4 ++--\n libstdc++-v3/include/bits/stl_tempbuf.h  | 2 +-\n libstdc++-v3/testsuite/17_intro/names.cc | 4 ++++\n 3 files changed, 7 insertions(+), 3 deletions(-)","diff":"diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h\nindex 98c2249039d1..3f4674d5ca42 100644\n--- a/libstdc++-v3/include/bits/stl_algo.h\n+++ b/libstdc++-v3/include/bits/stl_algo.h\n@@ -2511,7 +2511,7 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)\n       // [first,middle) and [middle,last).\n       _TmpBuf __buf(__first, std::min(__len1, __len2));\n \n-      if (__builtin_expect(__buf.size() == __buf.requested_size(), true))\n+      if (__builtin_expect(__buf.size() == __buf._M_requested_size(), true))\n \tstd::__merge_adaptive\n \t  (__first, __middle, __last, __len1, __len2, __buf.begin(), __comp);\n       else if (__builtin_expect(__buf.begin() == 0, false))\n@@ -5024,7 +5024,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO\n       // so the buffer only needs to fit half the range at once.\n       _TmpBuf __buf(__first, (__last - __first + 1) / 2);\n \n-      if (__builtin_expect(__buf.requested_size() == __buf.size(), true))\n+      if (__builtin_expect(__buf._M_requested_size() == __buf.size(), true))\n \tstd::__stable_sort_adaptive(__first,\n \t\t\t\t    __first + _DistanceType(__buf.size()),\n \t\t\t\t    __last, __buf.begin(), __comp);\ndiff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h\nindex 7a7619e2628d..8cc7b11abd21 100644\n--- a/libstdc++-v3/include/bits/stl_tempbuf.h\n+++ b/libstdc++-v3/include/bits/stl_tempbuf.h\n@@ -227,7 +227,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \n       /// Returns the size requested by the constructor; may be >size().\n       size_type\n-      requested_size() const\n+      _M_requested_size() const\n       { return _M_original_len; }\n \n       /// As per Table mumble.\ndiff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc\nindex f32205d9c7f5..e94da9defb29 100644\n--- a/libstdc++-v3/testsuite/17_intro/names.cc\n+++ b/libstdc++-v3/testsuite/17_intro/names.cc\n@@ -404,4 +404,8 @@\n # endif\n #endif\n \n+// PR libstdc++/119496\n+// _Temporary_buffer used to have a member with this name\n+#define requested_size 1\n+\n #include <bits/stdc++.h>\n","prefixes":["v1","1/1"]}