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 https://github.com/i
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
avoid-non-const-g
@@ -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
cppcoreguideline
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 ano