[PATCH] D129642: [Sema] Tweak diagnostic logic so suppress-in-hedaer logic works in tools too.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 14 01:29:43 PDT 2022


kadircet added inline comments.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:1784
 
   if (D->isInvalidDecl() || D->isUsed() || D->hasAttr<UnusedAttr>())
     return false;
----------------
i think we can just bail out early here when the main file is a header file (i.e. lang opts have `IsHeaderFile` set).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129642/new/

https://reviews.llvm.org/D129642



More information about the cfe-commits mailing list