{"id":2228656,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2228656/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/ae8NG1FTPg1QV34A@tucnak/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/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},"msgid":"<ae8NG1FTPg1QV34A@tucnak>","date":"2026-04-27T07:15:40","name":"libstdc++: Fix up std::is_scalar for std::meta::info [PR125024]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a8509df85dba142b2af83eef3875bd8154bb2b06","submitter":{"id":671,"url":"http://patchwork.ozlabs.org/api/1.1/people/671/?format=json","name":"Jakub Jelinek","email":"jakub@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/ae8NG1FTPg1QV34A@tucnak/mbox/","series":[{"id":501597,"url":"http://patchwork.ozlabs.org/api/1.1/series/501597/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=501597","date":"2026-04-27T07:15:40","name":"libstdc++: Fix up std::is_scalar for std::meta::info [PR125024]","version":1,"mbox":"http://patchwork.ozlabs.org/series/501597/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228656/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228656/checks/","tags":{},"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\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=ImLZyaHT;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=temperror (SPF Temporary Error: DNS Timeout) 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;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=ImLZyaHT","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124"],"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 4g3x3x3gxBz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 18:06:32 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 52AC54BAE7E7\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 08:06:28 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id 4B0084BAD142\n for <gcc-patches@gcc.gnu.org>; Mon, 27 Apr 2026 08:05:46 +0000 (GMT)","from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-400-OLEt-RMtPE2Y4cXzk976sA-1; Mon,\n 27 Apr 2026 04:05:44 -0400","from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 500ED19560B0; Mon, 27 Apr 2026 08:05:43 +0000 (UTC)","from tucnak.zalov.cz (unknown [10.44.34.21])\n by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id 922021800446; Mon, 27 Apr 2026 08:05:42 +0000 (UTC)","from tucnak.zalov.cz (localhost [127.0.0.1])\n by tucnak.zalov.cz (8.18.1/8.18.1) with ESMTPS id 63R85d7D1373337\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Mon, 27 Apr 2026 10:05:39 +0200","(from jakub@localhost)\n by tucnak.zalov.cz (8.18.1/8.18.1/Submit) id 63R85d7K1373336;\n Mon, 27 Apr 2026 10:05:39 +0200"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 52AC54BAE7E7","OpenDKIM Filter v2.11.0 sourceware.org 4B0084BAD142"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 4B0084BAD142","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 4B0084BAD142","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777277146; cv=none;\n b=l4PQ7RyiKrp+jM7zBGWpsx7G7bx6Rir0f1jkExGzBvBIvDtocpE6K3YpXTWVdaeV7kr5DzrNlGFvxAiaXlE0iGq+pfB0dFjRdtGD7Vttv3PB//V36zPLp4BHejad35bQIrOJ+fW7Xb7EIm7aKReuShjDlJHP0I9BUgMScG8Byf0=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777277146; c=relaxed/simple;\n bh=HMlRif0hO8Klp+ARBNesyQcdAL0fyWPcTPZp/ejfc84=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=kY3qzjE1XdsS0AYZaikqN1jf9X9q4PIj2C+vbug/0BFYkhYkvkjH7i6a8YOKkCk2V2pxEv6znvkOrN5VLJ7SFPkzgpkDWqrOHy43+bWdXlCUSeg63kuTVisz0H+rubHwSaoA96hcXXZdwmPqG0r8UamEmhgR/N+Vb5qSeCGKH5c=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777277145;\n h=from:from:reply-to:reply-to:subject:subject:date:date:\n message-id:message-id:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type:resent-to:resent-from:resent-message-id;\n bh=/fAfhjAeAu3IrNKxY1V59BlytRe+5DbItx58dGpUlZM=;\n b=ImLZyaHT5vhEOqye35LsbUFa79UHe1lcLzkyJtQAP9FuT6Jv5geeZbVruke9cwlRt0yjVS\n +Xiom69gklrZg1JKYgHkMSwvCCy5/PIf4Oz4QdLb3e2Rc0PWauZhK75PverPdLgj0tG0oV\n dFSXy7q7eTjzZx5m5rBK3ROudcLuuZE=","X-MC-Unique":"OLEt-RMtPE2Y4cXzk976sA-1","X-Mimecast-MFC-AGG-ID":"OLEt-RMtPE2Y4cXzk976sA_1777277143","Resent-From":"Jakub Jelinek <jakub@redhat.com>","Resent-Date":"Mon, 27 Apr 2026 10:05:39 +0200","Resent-Message-ID":"<ae8Y03n65E6Ck6cU@tucnak>","Resent-To":"Jonathan Wakely <jwakely@redhat.com>, gcc-patches@gcc.gnu.org,\n libstdc++@gcc.gnu.org","Date":"Mon, 27 Apr 2026 09:15:40 +0200","From":"Jakub Jelinek <jakub@redhat.com>","To":"Jonathan Wakely <jwakely@redhat.com>","Cc":"gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org","Subject":"[PATCH] libstdc++: Fix up std::is_scalar for std::meta::info\n [PR125024]","Message-ID":"<ae8NG1FTPg1QV34A@tucnak>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.111","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"PBSIfL1_r9D0dAU4TmNkrmubAYYhsnJZ1l7wlp_Vw2c_1777277143","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","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":"Jakub Jelinek <jakub@redhat.com>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"Hi!\n\nhttps://eel.is/c++draft/basic.types.general#9.sentence-1 says that\nstd::meta::info and its cv-qualified versions are scalar types too\n(and in https://eel.is/c++draft/basic.fundamental#19.sentence-1\nthat they are fundamental types too).\nNow, on the reflection side, eval_is_scalar_type is handled\nin the compiler and uses SCALAR_TYPE_P (type) which includes\nREFLECTION_TYPE_P check and eval_is_fundamental_type includes that\nexplicitly too.\nstd::is_fundamental uses\n   template<typename _Tp>\n     struct is_fundamental\n     : public __or_<is_arithmetic<_Tp>, is_void<_Tp>,\n                    is_null_pointer<_Tp>\n #if __cpp_impl_reflection >= 202506L\n                    , is_reflection<_Tp>\n #endif\n                    >::type\n     { };\nbut for std::is_scalar we apparently forgot to include is_reflection.\n\nThe following patch fixes that.\n\nBootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/16.2?\n\n2026-04-26  Jakub Jelinek  <jakub@redhat.com>\n\n\tPR libstdc++/125024\n\t* include/std/type_traits (std::is_scalar): For\n\t__cpp_impl_reflection >= 202506L handle is_reflection types as\n\tscalar.\n\t* testsuite/20_util/is_scalar/reflection.cc: New test.\n\n\n\tJakub","diff":"--- libstdc++-v3/include/std/type_traits.jj\t2026-04-09 18:09:11.002020134 +0200\n+++ libstdc++-v3/include/std/type_traits\t2026-04-26 19:20:37.109205308 +0200\n@@ -871,7 +871,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n   template<typename _Tp>\n     struct is_scalar\n     : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,\n-                   is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type\n+                   is_member_pointer<_Tp>, is_null_pointer<_Tp>\n+#if __cpp_impl_reflection >= 202506L\n+\t\t   , is_reflection<_Tp>\n+#endif\n+\t\t   >::type\n     { };\n \n   /// is_compound\n--- libstdc++-v3/testsuite/20_util/is_scalar/reflection.cc.jj\t2026-04-26 20:30:15.661943601 +0200\n+++ libstdc++-v3/testsuite/20_util/is_scalar/reflection.cc\t2026-04-26 20:49:40.107965736 +0200\n@@ -0,0 +1,13 @@\n+// { dg-do compile { target c++26 } }\n+// { dg-additional-options \"-freflection\" }\n+\n+#include <type_traits>\n+#include <testsuite_tr1.h>\n+\n+void test01()\n+{\n+  using std::is_scalar;\n+  using namespace __gnu_test;\n+\n+  static_assert(test_category<is_scalar, decltype (^^::)>(true), \"\");\n+}\n","prefixes":[]}