The paragraph of the C++98 standard that covers this scenario is found in [temp.dep.expr]
An id-expression is type-dependent if it contains:
- an identifier that was declared with a dependent type,
This wording is somewhat vague about identifiers that are overloaded and potentially declared with more than one type, as reported in DR 541 : http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html
This was resolved (in a more recent draft) by changing the paragraph to read:
An id-expression is type-dependent if it contains:
- an identifier associated by name lookup with one or more declarations declared with a dependent type,
When considering the following code:
template<class T>
struct S
{
static int f(int);
static int f(int*);
static T g(int*);
static int g(int);
static const int x = sizeof(f(0));
static const int y = sizeof(g(0));
};
My interpretation is that the identifier f
in the expression f(0)
is not dependent, while the identifier g
in the expression g(0)
is dependent.
When determining if a function-call expression is dependent - though overload resolution is not performed - all overloads of the function are considered.