[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-31 Thread Pascal Jungblut via cfe-commits
pascalj wrote: Thanks for your feedback! > * what about "static" non const global variables Good point, forgot about these. If both are allowed, it is more about the internal linkage than it is about the namespace. I renamed the option to `AllowInternalLinkage` and permit variables in

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-31 Thread Pascal Jungblut via cfe-commits
@@ -1,29 +1,39 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-avoid-non-const-global-variables %t +// RUN: %check_clang_tidy %s -check-suffix=DEFAULT cppcoreguidelines-avoid-non-const-global-variables %t +// RUN: %check_clang_tidy %s -check-suffix=NAMESPACE

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-31 Thread Pascal Jungblut via cfe-commits
https://github.com/pascalj updated https://github.com/llvm/llvm-project/pull/93827 >From abe862b84fd6915edb281a21e49f1be2aac3a626 Mon Sep 17 00:00:00 2001 From: Pascal Jungblut Date: Thu, 30 May 2024 14:28:50 +0200 Subject: [PATCH] Add option to ignore anonymous namespaces in

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-30 Thread Pascal Jungblut via cfe-commits
https://github.com/pascalj created https://github.com/llvm/llvm-project/pull/93827 Add an option to ignore warnings for cppcoreguidelines avoid-non-const-global-variables. Understandably, the core guidelines discourage non const global variables, even at the TU level (see