From patchwork Mon Sep 23 23:42:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathaniel Shead X-Patchwork-Id: 1988720 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=V1c79ToD; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XCKL9296Zz1xsN for ; Tue, 24 Sep 2024 09:42:53 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B30F385C6D2 for ; Mon, 23 Sep 2024 23:42:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 243EE3858D26 for ; Mon, 23 Sep 2024 23:42:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 243EE3858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 243EE3858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727134953; cv=none; b=vHdGGfCwQaKf6rPA+Wr1/dJTl88RrM/2GFBomTjQGXkIXCnSapNN7nwXFme8P/YydGkkR0jwJoB24uuhwpK0BMhwhVDXJeJ463OXWiXbeNvN+0mwwru3Fzvu0oH1DpQqpeNkA/L0oPTbhvlUThq8S/HFMEuNV8K/adqpmsxqAM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727134953; c=relaxed/simple; bh=ft5V4efpdJd/uJifmHdKugi5AU3XRSVFAGvd8DBoqm8=; h=DKIM-Signature:Message-ID:Date:From:To:Subject:MIME-Version; b=pbqlHGaPAgiVq0r3KDZtEypQ/TF+NKbp6Y6gu7xigvsajKPI7nVPwHDqYphtYtu818TW7WmaKI5or3TxgyVGZHQNs3Kt0pcJL0Lc8aYdCeaoPOj4F/DAvKGW4VFzFAwEmdZDbzIqVbt7PFrmBVC84efYHEOXFEnSV5p7Vh4SL+U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-20549ca1fe3so2178855ad.1 for ; Mon, 23 Sep 2024 16:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727134950; x=1727739750; darn=gcc.gnu.org; h=content-disposition:mime-version:subject:cc:to:from:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=92/EZX8b3thjOhv69kedIyV0/kyzCQPAFV8EbkF+co0=; b=V1c79ToDHcEB1ZrHb8ga2FB1wiUVAF152f++a+vLTVmgMnsrOlA8yYsCQx6jkcPudS z728Ed9OwnA4AsV7IygXvw9oeKVTpW6P88Jk4whV0c+qAIrXOiJJkXhyFEDzhRaDp7Pf pkddz/GlA2ilVe3SjzmtnlSg8kCNe6yoYwBof200x/9fPReVrlzOEDQsH0gJoX32yq41 dPqlU9PmsfdPUAbXqHKRrtfMh2QaAryIY6ea5kRTDO5wYBoXP6qCKbYE3c9wI5DKTh+Z v65bSqj0oxwMyfzqg644CHBLbhajv3w231w9iv8IofX5nP0h0kkIeQuUiwZQkpMyMIxU LczA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727134950; x=1727739750; h=content-disposition:mime-version:subject:cc:to:from:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=92/EZX8b3thjOhv69kedIyV0/kyzCQPAFV8EbkF+co0=; b=i214z8FI3zS6a+xqfwOoL1YK1S/9JFam6ACRc6x2RGd+D3PGJvAWZSlFhdCZon9x5H zz1QkUJ9uKr1nmDfIqfqG7cq8/aXnm0qJs6O2qgxGGTH1h4Tj3nWMi6ns3TPwTSQdrK5 83lXQ2CCIL67g48X3ceddUsUAI3Ed14fOhnV1pdOBqky1y2pbNaa4Pp7btS7/W9x33YG Dte1+j9VoMlp9Ony3TLT2ehNbtoc2WF+YN2DPWxGYMqzDDGeSsM5ZvhOSc1w8F66mIfl eG45yfLXdyY824wMegWPkD5BQQZ5Z96zS0sL2VfJKWmcgMV4g8903owqx545fmlNbAi8 OqSQ== X-Gm-Message-State: AOJu0Ywpo3A7+UD96q0tu++MeY5AhTiLA9grnOJpXrqjusinc2W7/gT3 L6fBlRUJC8t2+zTIyLJH6J6ue9Z2ouXf3DEB2wyJm5bF7B+F27X76xvxUw== X-Google-Smtp-Source: AGHT+IEsw7tVtVG1mhcIC4alk3c+MraynNg0/v+RK+AxATLHy4EQeOvIUmsawoUsnTzOZlPMYhE3Zw== X-Received: by 2002:a17:902:dac4:b0:205:5fc8:9bda with SMTP id d9443c01a7336-20aefd5da57mr4593485ad.1.1727134949826; Mon, 23 Sep 2024 16:42:29 -0700 (PDT) Received: from Thaum. ([163.47.68.2]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af1858b4dsm935525ad.263.2024.09.23.16.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 16:42:29 -0700 (PDT) Message-ID: <66f1fce5.170a0220.150b6f.03f5@mx.google.com> X-Google-Original-Message-ID: Date: Tue, 24 Sep 2024 09:42:22 +1000 From: Nathaniel Shead To: gcc-patches@gcc.gnu.org Cc: Jason Merrill , Nathan Sidwell Subject: [PATCH 00/10] c++/modules: Implement P1815 "Translation-unit-local entities" MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org This patch series implements most of the changes made by P1815. It also cleans up a few bugs found along the way that impacted tests I wrote. The whole patch series was bootstrapped on x86_64-pc-linux-gnu with no regressions. Nathaniel Shead (10): libstdc++: Remove unnecessary 'static' from __is_specialization_of c++: Update decl_linkage for C++11 c++/modules: Use decl_linkage in maybe_record_mergeable_decl c++/modules: Fix linkage checks for exported using-decls c++/modules: Allow imported references in constant expressions c++/modules: Detect exposures of TU-local entities c++/modules: Implement ignored TU-local exposures c++/modules: Support anonymous namespaces in header units c++/modules: Check linkage for exported declarations c++/modules: Validate external linkage definitions in header units [PR116401] gcc/c-family/c.opt | 4 + gcc/cp/cp-objcp-common.cc | 1 + gcc/cp/cp-tree.def | 6 + gcc/cp/cp-tree.h | 29 +- gcc/cp/decl.cc | 1 + gcc/cp/decl2.cc | 1 + gcc/cp/module.cc | 764 +++++++++++++++++--- gcc/cp/name-lookup.cc | 88 +-- gcc/cp/name-lookup.h | 2 +- gcc/cp/parser.cc | 25 +- gcc/cp/parser.h | 3 + gcc/cp/pt.cc | 100 ++- gcc/cp/tree.cc | 92 ++- gcc/doc/invoke.texi | 19 +- gcc/testsuite/g++.dg/modules/block-decl-2.C | 2 +- gcc/testsuite/g++.dg/modules/cexpr-5_a.C | 13 + gcc/testsuite/g++.dg/modules/cexpr-5_b.C | 9 + gcc/testsuite/g++.dg/modules/export-3.C | 2 +- gcc/testsuite/g++.dg/modules/export-6.C | 35 + gcc/testsuite/g++.dg/modules/hdr-2.H | 164 +++++ gcc/testsuite/g++.dg/modules/internal-1.C | 15 +- gcc/testsuite/g++.dg/modules/internal-3.C | 18 + gcc/testsuite/g++.dg/modules/internal-4.C | 112 +++ gcc/testsuite/g++.dg/modules/internal-5_a.C | 104 +++ gcc/testsuite/g++.dg/modules/internal-5_b.C | 29 + gcc/testsuite/g++.dg/modules/internal-6.C | 24 + gcc/testsuite/g++.dg/modules/internal-7_a.C | 75 ++ gcc/testsuite/g++.dg/modules/internal-7_b.C | 21 + gcc/testsuite/g++.dg/modules/internal-8_a.H | 28 + gcc/testsuite/g++.dg/modules/internal-8_b.C | 29 + gcc/testsuite/g++.dg/modules/linkage-2.C | 5 +- gcc/testsuite/g++.dg/modules/macro-4_c.H | 2 +- gcc/testsuite/g++.dg/modules/mod-sym-4.C | 4 +- gcc/testsuite/g++.dg/modules/pr106761.h | 2 +- gcc/testsuite/g++.dg/modules/pr98843_b.H | 2 +- gcc/testsuite/g++.dg/modules/pr99468.H | 2 +- gcc/testsuite/g++.dg/modules/pragma-1_a.H | 2 +- gcc/testsuite/g++.dg/modules/tpl-ary-1.h | 2 +- gcc/testsuite/g++.dg/modules/using-10.C | 56 +- gcc/testsuite/g++.dg/modules/using-12.C | 42 +- gcc/testsuite/g++.dg/modules/using-27.C | 14 + gcc/testsuite/g++.dg/modules/using-28_a.C | 12 + gcc/testsuite/g++.dg/modules/using-28_b.C | 8 + libcc1/libcp1plugin.cc | 2 +- libstdc++-v3/include/std/format | 5 +- 45 files changed, 1738 insertions(+), 237 deletions(-) create mode 100644 gcc/testsuite/g++.dg/modules/cexpr-5_a.C create mode 100644 gcc/testsuite/g++.dg/modules/cexpr-5_b.C create mode 100644 gcc/testsuite/g++.dg/modules/export-6.C create mode 100644 gcc/testsuite/g++.dg/modules/hdr-2.H create mode 100644 gcc/testsuite/g++.dg/modules/internal-3.C create mode 100644 gcc/testsuite/g++.dg/modules/internal-4.C create mode 100644 gcc/testsuite/g++.dg/modules/internal-5_a.C create mode 100644 gcc/testsuite/g++.dg/modules/internal-5_b.C create mode 100644 gcc/testsuite/g++.dg/modules/internal-6.C create mode 100644 gcc/testsuite/g++.dg/modules/internal-7_a.C create mode 100644 gcc/testsuite/g++.dg/modules/internal-7_b.C create mode 100644 gcc/testsuite/g++.dg/modules/internal-8_a.H create mode 100644 gcc/testsuite/g++.dg/modules/internal-8_b.C create mode 100644 gcc/testsuite/g++.dg/modules/using-27.C create mode 100644 gcc/testsuite/g++.dg/modules/using-28_a.C create mode 100644 gcc/testsuite/g++.dg/modules/using-28_b.C