Implement P1766R1: diagnose giving non-C-compatible classes a typedef name for linkag...
authorRichard Smith <richard@metafoo.co.uk>
Thu, 6 Feb 2020 02:52:38 +0000 (18:52 -0800)
committerRichard Smith <richard@metafoo.co.uk>
Fri, 7 Feb 2020 19:47:37 +0000 (11:47 -0800)
commit7ae1b4a0ce9c7f269cf3069e41496a78e3f28d49
tree62476fa16fb80a6630c2ef6ad00a1a1bd2937a2a
parent884acbb9e167d5668e43581630239d688edec8ad
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
19 files changed:
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDecl.cpp
clang/test/Analysis/inlining/eager-reclamation-path-notes.cpp
clang/test/Analysis/padding_cpp.cpp
clang/test/Analysis/padding_message.cpp
clang/test/CXX/class/class.local/p4.cpp
clang/test/CXX/class/class.union/p2-0x.cpp
clang/test/CXX/drs/dr4xx.cpp
clang/test/Modules/submodules-merge-defs.cpp
clang/test/OpenMP/target_map_codegen.cpp
clang/test/SemaCXX/anonymous-struct.cpp
clang/test/SemaCXX/linkage.cpp
clang/test/SemaCXX/linkage2.cpp
clang/test/SemaCXX/undefined-internal.cpp
clang/test/SemaCXX/warn-unused-filescoped.cpp
clang/test/SemaCXX/warn-unused-local-typedef.cpp
clang/test/SemaTemplate/instantiate-function-2.cpp
clang/www/cxx_status.html