mbox series

[00/10] c++/modules: Implement P1815 "Translation-unit-local entities"

Message ID 66f1fce5.170a0220.150b6f.03f5@mx.google.com
Headers show
Series c++/modules: Implement P1815 "Translation-unit-local entities" | expand

Message

Nathaniel Shead Sept. 23, 2024, 11:42 p.m. UTC
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