[PATCH] D67740: [Consumed] Refactor and improve diagnostics
David Blaikie via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 26 17:59:02 PDT 2019
dblaikie accepted this revision.
dblaikie added inline comments.
This revision is now accepted and ready to land.
================
Comment at: lib/Sema/SemaDeclAttr.cpp:1249
+ Diag(A->getLoc(), diag::warn_consumable_attr_for_unconsumable_type) <<
+ A << (isa<ParmVarDecl>(D) ? 0 : 1) << Type;
+ return false;
----------------
Do you need the "? 0 : 1" here? Or would the boolean value be sufficient to use directly?
================
Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:609-610
+ if (isa<ParamTypestateAttr>(TmplAttr) || isa<ReturnTypestateAttr>(TmplAttr)) {
+ if (!CheckParamOrReturnTypestateAttr(TmplAttr, New, Tmpl))
+ continue; // don't add
----------------
Collapse these two conditions into one 'if', perhaps?
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67740/new/
https://reviews.llvm.org/D67740
More information about the cfe-commits
mailing list