"using-directives" add additional scopes to the set of scopes searched during name lookup. All identifiers in these scopes become visible. If two different namespaces contain some identifiers with same names then it can quickly become error-prone as it increases the possibility that the identifier found by the compiler does not meet developer expectations. This rule raises an issue as soon a "using" directive leads to introduce an ambiguity.


== Noncompliant Code Example

----
namespace NS1 {
  int foo;
  int bar;
}

using namespace NS1; // OK

namespace NS2 {
  int foo;
  int somethingElse;
}

using namespace NS2; // Noncompliant as there might be an ambiguity between NS1::foo and NS2::foo
----


== See

* MISRA {cpp}:2008, 7-3-4 - using-directives shall not be used.


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
