vingeldal added inline comments.

================
Comment at: 
clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.cpp:50
+    // variables in a function.
+    if (!Variable->isLocalVarDecl()) {
+      diag(Variable->getLocation(), "variable %0 is non-const and globally "
----------------
aaron.ballman wrote:
> aaron.ballman wrote:
> > I think this should be handled in the matcher rather than here. I'd add a 
> > local matcher for `isLocalVarDecl()` and add it to the `unless()` matcher. 
> > WDYT?
> You should be able to remove this change now.
Right, sorry about that


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77461



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to