[all-commits] [llvm/llvm-project] fee3cc: [C++20][Modules] Improve handing of Private Module...

iains via All-commits all-commits at lists.llvm.org
Sun Aug 21 02:20:53 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fee3cccc6cdabdeddc688cf7a15b144c814dd93d
  Author: Iain Sandoe <iain at sandoe.co.uk>
  Date:   2022-08-21 (Sun, 21 Aug 2022)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaLookup.cpp
    M clang/lib/Sema/SemaModule.cpp
    M clang/test/Modules/Reachability-Private.cpp
    A clang/test/Modules/cxx20-10-5-ex1.cpp

  Log Message:
  [C++20][Modules] Improve handing of Private Module Fragment diagnostics.

This adds a check for exported inline functions, that there is a definition in
the definition domain (which, in practice, can only be the module purview but
before any PMF starts) since the PMF definition domain cannot contain exports.

This is:
If an inline function or variable that is attached to a named module is declared in
a definition domain, it shall be defined in that domain.

The patch also amends diagnostic output by excluding the PMF sub-module from the
set considered as sources of missing decls.  There is no point in telling the user
that the import of a PMF object is missing - since such objects are never reachable
to an importer.  We still show the definition (as unreachable), to help point out

Differential Revision: https://reviews.llvm.org/D128328

More information about the All-commits mailing list