rspec/rules/S997/description.adoc

11 lines
681 B
Plaintext
Raw Normal View History

2020-06-30 12:50:59 +02:00
Declaring names in appropriate namespaces reduces the number of names found during lookup, decreasing the risk of name clash and of surprising name lookup.
This rule raises an issue when a name in the global namespace has external linkage and therefore can be accessed from outside a particular translation unit.
Some names have to be declared in the global namespace, and are excluded from this rule:
2021-01-27 13:42:22 +01:00
* ``++main++`` (or its variants)
* Overloads of the global ``++new++`` & ``++delete++`` operators
In addition, no issue is raised for function definitions because they can only be accessed from different translation units through a forward declaration that will be flagged.