[all-commits] [llvm/llvm-project] 7ae1b4: Implement P1766R1: diagnose giving non-C-compatibl...

Richard Smith via All-commits all-commits at lists.llvm.org
Fri Feb 7 11:47:47 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ae1b4a0ce9c7f269cf3069e41496a78e3f28d49
      https://github.com/llvm/llvm-project/commit/7ae1b4a0ce9c7f269cf3069e41496a78e3f28d49
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-02-07 (Fri, 07 Feb 2020)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/Analysis/inlining/eager-reclamation-path-notes.cpp
    M clang/test/Analysis/padding_cpp.cpp
    M clang/test/Analysis/padding_message.cpp
    M clang/test/CXX/class/class.local/p4.cpp
    M clang/test/CXX/class/class.union/p2-0x.cpp
    M clang/test/CXX/drs/dr4xx.cpp
    M clang/test/Modules/submodules-merge-defs.cpp
    M clang/test/OpenMP/target_map_codegen.cpp
    M clang/test/SemaCXX/anonymous-struct.cpp
    M clang/test/SemaCXX/linkage.cpp
    M clang/test/SemaCXX/linkage2.cpp
    M clang/test/SemaCXX/undefined-internal.cpp
    M clang/test/SemaCXX/warn-unused-filescoped.cpp
    M clang/test/SemaCXX/warn-unused-local-typedef.cpp
    M clang/test/SemaTemplate/instantiate-function-2.cpp
    M clang/www/cxx_status.html

  Log Message:
  -----------
  Implement P1766R1: diagnose giving non-C-compatible classes a typedef name for linkage purposes.

Summary:
Due to a recent (but retroactive) C++ rule change, only sufficiently
C-compatible classes are permitted to be given a typedef name for
linkage purposes. Add an enabled-by-default warning for these cases, and
rephrase our existing error for the case where we encounter the typedef
name for linkage after we've already computed and used a wrong linkage
in terms of the new rule.

Reviewers: rjmccall

Subscribers: cfe-commits

Tags: #clang

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




More information about the All-commits mailing list