From d1fe2c3ef54c6551668b0ee3305bc496472b0304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Joly?= Date: Tue, 23 Jan 2024 01:58:20 +0100 Subject: [PATCH] CPP-4873 S1001: Literals namespaces should be allowlisted from the rule --- rules/S1001/cfamily/rule.adoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rules/S1001/cfamily/rule.adoc b/rules/S1001/cfamily/rule.adoc index 7d7a9bac8e4..df2079bc164 100644 --- a/rules/S1001/cfamily/rule.adoc +++ b/rules/S1001/cfamily/rule.adoc @@ -2,8 +2,11 @@ `using` directives add additional scopes to the set of scopes searched during name lookup. All identifiers in these scopes become visible, increasing the possibility that the identifier found by the compiler does not meet developer expectations. -Using-declarations or fully-qualified names restricts the set of names considered to only the name explicitly specified, and so these are safer options. +_Using-declarations_ or fully-qualified names restricts the set of names considered to only the name explicitly specified, and so these are safer options. +=== Exceptions + +It is not easy to fully qualify the content of the `std::literals` and `std::placeholders` namespaces. Therefore, this rule does not raise violations for `using` directives that target these namespaces or their sub-namespaces. === Noncompliant code example