[PATCH] D107613: [Clang][DiagnosticSemaKinds] combine diagnostic texts
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 6 04:15:06 PDT 2021
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM with some minor tweaks to avoid `hasAttr` followed by `getAttr`. Thanks!
================
Comment at: clang/lib/Sema/SemaDecl.cpp:3356-3359
if (New->hasAttr<InternalLinkageAttr>() &&
!Old->hasAttr<InternalLinkageAttr>()) {
- Diag(New->getLocation(), diag::err_internal_linkage_redeclaration)
- << New->getDeclName();
+ Diag(New->getLocation(), diag::err_attribute_missing_on_first_decl)
+ << New->getAttr<InternalLinkageAttr>();
----------------
================
Comment at: clang/lib/Sema/SemaDecl.cpp:4170-4173
if (New->hasAttr<InternalLinkageAttr>() &&
!Old->hasAttr<InternalLinkageAttr>()) {
- Diag(New->getLocation(), diag::err_internal_linkage_redeclaration)
- << New->getDeclName();
+ Diag(New->getLocation(), diag::err_attribute_missing_on_first_decl)
+ << New->getAttr<InternalLinkageAttr>();
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107613/new/
https://reviews.llvm.org/D107613
More information about the cfe-commits
mailing list