From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4F90E15808B for ; Fri, 4 Oct 2024 10:37:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 89C39E29F6; Fri, 4 Oct 2024 10:37:04 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 645B4E29F6 for ; Fri, 4 Oct 2024 10:37:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9B628335C2E for ; Fri, 4 Oct 2024 10:37:03 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 08C7719CB for ; Fri, 4 Oct 2024 10:37:02 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1728038217.fd69f7a88e4fa1dd773750c0ce7a31c20f452ce2.sam@gentoo> Subject: [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/ X-VCS-Repository: proj/gcc-patches X-VCS-Files: 15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch 15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch 15.0.0/gentoo/README.history X-VCS-Directories: 15.0.0/gentoo/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: fd69f7a88e4fa1dd773750c0ce7a31c20f452ce2 X-VCS-Branch: master Date: Fri, 4 Oct 2024 10:37:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ed295e57-a918-4723-9f6b-f25bdf9f2385 X-Archives-Hash: e6252cfcee99674ab109ce867a5774e9 commit: fd69f7a88e4fa1dd773750c0ce7a31c20f452ce2 Author: Sam James gentoo org> AuthorDate: Fri Oct 4 10:36:15 2024 +0000 Commit: Sam James gentoo org> CommitDate: Fri Oct 4 10:36:57 2024 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=fd69f7a8 15.0.0: drop patches merged upstream - 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch - 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch Signed-off-by: Sam James gentoo.org> ...erences-to-internal-linkage-vars-in-C-11-.patch | 96 ---------------------- ...e-underlying-decl-rather-than-the-USING_D.patch | 76 ----------------- 15.0.0/gentoo/README.history | 5 ++ 3 files changed, 5 insertions(+), 172 deletions(-) diff --git a/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch b/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch deleted file mode 100644 index 4e2f1f4..0000000 --- a/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 923bd335a44b1b556d705a7f1d36a2e9c06d9c5c Mon Sep 17 00:00:00 2001 -Message-ID: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org> -From: Nathaniel Shead -Date: Fri, 4 Oct 2024 12:41:49 +1000 -Subject: [PATCH 1/2] c++: Allow references to internal-linkage vars in C++11 - [PR113266] - -[temp.arg.nontype] changed in C++11 to allow naming internal-linkage -variables and functions. We currently already handle internal-linkage -functions, but variables were missed; this patch updates this. - - PR c++/113266 - PR c++/116911 - -gcc/cp/ChangeLog: - - * parser.cc (cp_parser_template_argument): Allow - internal-linkage variables since C++11. - -gcc/testsuite/ChangeLog: - - * g++.dg/cpp0x/nontype6.C: New test. - -Signed-off-by: Nathaniel Shead ---- - gcc/cp/parser.cc | 17 ++++++++++++----- - gcc/testsuite/g++.dg/cpp0x/nontype6.C | 19 +++++++++++++++++++ - 2 files changed, 31 insertions(+), 5 deletions(-) - create mode 100644 gcc/testsuite/g++.dg/cpp0x/nontype6.C - -diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc -index 08f9c89f1f0..e758ddeb1d5 100644 ---- a/gcc/cp/parser.cc -+++ b/gcc/cp/parser.cc -@@ -19864,9 +19864,11 @@ cp_parser_template_argument (cp_parser* parser) - - -- the name of a non-type template-parameter; or - -- -- the name of an object or function with external linkage... -+ -- the name of an object or function with external (or internal, -+ since C++11) linkage... - -- -- the address of an object or function with external linkage... -+ -- the address of an object or function with external (or internal, -+ since C++11) linkage... - - -- a pointer to member... */ - /* Look for a non-type template parameter. */ -@@ -19929,11 +19931,16 @@ cp_parser_template_argument (cp_parser* parser) - probe = TREE_OPERAND (probe, 1); - if (VAR_P (probe)) - { -- /* A variable without external linkage might still be a -+ /* A variable without valid linkage might still be a - valid constant-expression, so no error is issued here - if the external-linkage check fails. */ -- if (!address_p && !DECL_EXTERNAL_LINKAGE_P (probe)) -- cp_parser_simulate_error (parser); -+ if (!address_p && cxx_dialect < cxx17) -+ { -+ linkage_kind linkage = decl_linkage (probe); -+ if (linkage != lk_external -+ && (cxx_dialect < cxx11 || linkage != lk_internal)) -+ cp_parser_simulate_error (parser); -+ } - } - else if (is_overloaded_fn (argument)) - /* All overloaded functions are allowed; if the external -diff --git a/gcc/testsuite/g++.dg/cpp0x/nontype6.C b/gcc/testsuite/g++.dg/cpp0x/nontype6.C -new file mode 100644 -index 00000000000..5543d1e8b6d ---- /dev/null -+++ b/gcc/testsuite/g++.dg/cpp0x/nontype6.C -@@ -0,0 +1,19 @@ -+// PR c++/113266, PR c++/116911 -+// { dg-do compile } -+ -+template struct a {}; -+static int guard1; -+a b; // { dg-error "constant-expression|invalid" "" { target c++98_only } } -+ -+namespace { -+ int guard2; -+} -+a c; // OK in C++98 because guard2 has external linkage -+ // OK since C++11 because we can refer to an internal linkage decl -+ -+void nolinkage() { -+ static int guard3; -+ a d; // { dg-error "constant-expression|invalid" "" { target c++98_only } } -+ // { dg-error "constant expression|no linkage" "" { target { c++11 && c++14_down } } .-1 } -+ // OK since C++17 since we can now refer to no-linkage decls -+} --- -2.46.2 - diff --git a/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch b/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch deleted file mode 100644 index ab12bf6..0000000 --- a/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch +++ /dev/null @@ -1,76 +0,0 @@ -From ba7c4e109fc589603911630deb2f19eba88bdbe8 Mon Sep 17 00:00:00 2001 -Message-ID: -In-Reply-To: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org> -References: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org> -From: Nathaniel Shead -Date: Fri, 4 Oct 2024 10:52:02 +1000 -Subject: [PATCH 2/2] c++: Return the underlying decl rather than the - USING_DECL from update_binding [PR116913] - -Users of pushdecl assume that the returned decl will be a possibly -updated decl matching the one that was passed in. My r15-3910 change -broke this since in some cases we would now return USING_DECLs; this -patch fixes the situation. - - PR c++/116913 - -gcc/cp/ChangeLog: - - * name-lookup.cc (update_binding): Return the strip_using'd old - decl rather than the binding. - -gcc/testsuite/ChangeLog: - - * g++.dg/lookup/using70.C: New test. - -Signed-off-by: Nathaniel Shead ---- - gcc/cp/name-lookup.cc | 4 ++-- - gcc/testsuite/g++.dg/lookup/using70.C | 13 +++++++++++++ - 2 files changed, 15 insertions(+), 2 deletions(-) - create mode 100644 gcc/testsuite/g++.dg/lookup/using70.C - -diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc -index 4754ef5a522..609bd6e8c9b 100644 ---- a/gcc/cp/name-lookup.cc -+++ b/gcc/cp/name-lookup.cc -@@ -3101,7 +3101,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot, - { - if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl))) - /* Two type decls to the same type. Do nothing. */ -- return old_bval; -+ return old; - else - goto conflict; - } -@@ -3114,7 +3114,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot, - - /* The new one must be an alias at this point. */ - gcc_assert (DECL_NAMESPACE_ALIAS (decl)); -- return old_bval; -+ return old; - } - else if (TREE_CODE (old) == VAR_DECL) - { -diff --git a/gcc/testsuite/g++.dg/lookup/using70.C b/gcc/testsuite/g++.dg/lookup/using70.C -new file mode 100644 -index 00000000000..14838eea7ec ---- /dev/null -+++ b/gcc/testsuite/g++.dg/lookup/using70.C -@@ -0,0 +1,13 @@ -+// PR c++/116913 -+// { dg-do compile { target c++11 } } -+ -+namespace ns { -+ struct c {}; -+ using d = int; -+} -+ -+using ns::c; -+using ns::d; -+ -+using c = ns::c; -+using d = ns::d; --- -2.46.2 - diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history index 2d85dc2..f58b501 100644 --- a/15.0.0/gentoo/README.history +++ b/15.0.0/gentoo/README.history @@ -1,3 +1,8 @@ +15 ???? + + - 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch + - 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch + 14 4 October 2024 - 70_all_middle-end-check-explicitly-for-external-or-constant.patch