[Clang][DiagnosticSemaKinds] combine diagnostic texts
authorNick Desaulniers <ndesaulniers@google.com>
Fri, 6 Aug 2021 20:48:20 +0000 (13:48 -0700)
committerNick Desaulniers <ndesaulniers@google.com>
Fri, 6 Aug 2021 20:58:21 +0000 (13:58 -0700)
commitd238b60285820691b08bcca3ec510d13ea46a5ed
treec78c63ca39a545272d86191a7c6f800f2e21e851
parentbb81e7083d25bfc9bcf2bd69f5431d0c53b86a32
[Clang][DiagnosticSemaKinds] combine diagnostic texts

The diagnostic texts for warning on attributes that don't appear on the
initial declaration is generally useful.  We'd like to re-use it in
D106030, but first let's combine two that already are very similar so we
may re-use it a third time in that commit.

Also, fix a few places that were using notePreviousDefinition to point
to declarations, to instead use diag::note_previous_declaration.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D107613
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDecl.cpp
clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.noreturn/p1.cpp
clang/test/Sema/attr-weak.c
clang/test/Sema/internal_linkage.c
clang/test/SemaCXX/internal_linkage.cpp