[PATCH] D148702: [clang] Add Parse and Sema support for RegularKeyword attributes
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 25 07:10:28 PDT 2023
erichkeane added a comment.
So I have 1 issue that is throughout the patch, but I'm ok with the patch otherwise. This'll get a LGTM after that is fixed.
================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:2902
S.Diag(AL.getRange().getBegin(), diag::err_attribute_wrong_decl_type)
- << AL << ExpectedTypeOrNamespace;
+ << AL << 0 << ExpectedTypeOrNamespace;
return;
----------------
Every where you are doing just a '0' in a diagnostic here it makes it incredibly unreadable. I'd prefer 1 of 2 solutions:
1- Create an enum somewhere that encodes the meaning here, and use those instead.
2- use a `/*Whatever*/` comment every place you're passing a raw literal.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148702/new/
https://reviews.llvm.org/D148702
More information about the cfe-commits
mailing list