[Clang] Reword diagnostic for scope identifier with linkage
authorJun Zhang <jun@junz.org>
Mon, 12 Sep 2022 14:21:17 +0000 (22:21 +0800)
committerJun Zhang <jun@junz.org>
Mon, 12 Sep 2022 14:40:54 +0000 (22:40 +0800)
commit1d51bb824f25140a5b1aa783f6860ac3e7f7d16d
treec676e252ea8eaff43ed13bcc4fa50b27a0ed80ff
parente4f4542517fbd678f25fa4b5771641ace6915804
[Clang] Reword diagnostic for scope identifier with linkage

If the declaration of an identifier has block scope, and the identifier has
external or internal linkage, the declaration shall have no initializer for
the identifier.

Clang now gives a more suitable diagnosis for this case.
Fixes https://github.com/llvm/llvm-project/issues/57478

Signed-off-by: Jun Zhang <jun@junz.org>
 Differential Revision: https://reviews.llvm.org/D133088
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDecl.cpp
clang/test/Parser/cxx1z-decomposition.cpp
clang/test/Sema/array-init.c
clang/test/Sema/err-decl-block-extern-no-init.c [new file with mode: 0644]
clang/test/Sema/private-extern.c