[stmt.ambig] (original) (raw)
The disambiguation is purely syntactic; that is, the meaning of the names occurring in such a statement, beyond whether they aretype-names or not, is not generally used in or changed by the disambiguation.
Class templates are instantiated as necessary to determine if a qualified name is a type-name.
Disambiguation precedes parsing, and a statement disambiguated as a declaration may be an ill-formed declaration.
If, during parsing, lookup finds that a name in a template argument is bound to (part of) the declaration being parsed, the program is ill-formed.
No diagnostic is required.
[Example 3: struct T1 { T1 operator()(int x) { return T1(x); } int operator=(int x) { return x; } T1(int) { } };struct T2 { T2(int) { } };int a, (*(*b)(T2))(int), c, d;void f() { T1(a) = 3, T2(4), (*(*b)(T2(c)))(int(d)); } — _end example_]