Yes, A is a regular search for an unqualified name according to 3.4.1, a sequential search of the areas covering a nested qualifier name, except that only classes and namespace names are found. For example, you can get the following:
int main() { int X; X::i = 42;
http://ideone.com/NaEIVd
In fact, the use of this loophole is not recommended; if X were an object of type class, then X::i and Xi could be completely different.
To arrive at this conclusion from the Standard, start with 3.4.3 (a qualified search, which is a high-level construct that we ultimately analyze), which reads in paragraph 1,
The name of a member of a class or namespace or enumerator can be passed after the statement (5.1) resolving the scope applied to the nested qualifier name, which designates its class, namespace or enumeration. If the statement with the resolution in resolution n :: the scope name is not preceded by the decltype specifier, the search for the name preceding this: considers only namespaces, types, and templates whose specialization is types. If the name found does not indicate a namespace or class, enumeration or dependent type, the program is poorly formed.
When reading paragraph 2, this does not apply, since a qualified identifier is not declared. The remaining paragraphs also indicate non-applicable exceptions. So what precedes :: ? Refer to the grammar.
nested-name-specifier: :: type-name :: namespace-name :: decltype-specifier :: nested-name-specifier identifier :: nested-name-specifier templateopt simple-template-id ::
Only type-name :: and namespace-name :: match our a priori criteria. They also overlap with what we have found so far. How is type-name or namespace-name usually resolved in a specific context? Unskilled search. Go to 3.4.1.
Firstly, 3.4.1 / 1 is a general rule that should be considered:
In all cases listed in 3.4.1, the search area searches for a declaration in the order specified in each of the relevant categories; the name search ends as soon as an ad is found for the name. If the ad is not found, the program is poorly formed.
The following applicable paragraph is 6:
The name used in the definition of the function following the declarator-id function, which is a member of the namespace N (where, for the purposes of presentation only, N can represent the global scope) must be declared before use in the block in which it is used, or in one of its closing blocks (6.3), or must be declared before it is used in the namespace N or, if N is a nested namespace, must be declared before use in one of the Ns spanning the namespace.
This rule does not tell us about searching the global namespace for a name, but it mentions a function that encompasses the namespace (in this case global) in the list, and paragraph 1 talks about searching the list of namespaces. So, to create a name search.
Not surprisingly, a recursive search prioritizes internal, private namespaces, but you really don't have that kind of thing, so I'll stay here :). It is much faster to leave compilation to the compiler and work manually only in case of a problem.