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/isocpp/CppCoreGuidelines/issues/2195). However,
having a small TU with an interface that uses a non const variable from
an anonymous namespace can be a valid choice.
This adds an option that disables the warning just for anonymous
namespaces, i.e. at the file level. The default is still to show a
warning, just as before.
Ignore static variables declared within the scope of class/struct.
Those variables should be covered by I.3 rule.
Fixes: #47384
Reviewed By: carlosgalvezp
Differential Revision: https://reviews.llvm.org/D157180