Created on 1999-07-14.00:00:00 last changed 197 months ago
[Moved to DR at 10/01 meeting.]
Proposed resolution (04/01):
Change the example in 6.5.3 [basic.lookup.unqual] paragraph 3 to read:
typedef int f; namespace N { struct A { friend int f(A &); operator int(); void g(A a) { int i = f(a); // f is the typedef, not the friend function: // equivalent to int(a) } }; }
Delete the sentence immediately following the example:
The expression f(a) is a cast-expression equivalent to int(a).
The example in 6.5.3 [basic.lookup.unqual] paragraph 3 is incorrect:
typedef int f; struct A { friend void f(A &); operator int(); void g(A a) { f(a); } };Regardless of the resolution of other issues concerning the lookup of names in friend declarations, this example is ill-formed (the function and the typedef cannot exist in the same scope).
One possible repair of the example would be to make f a class with a constructor taking either A or int as its parameter.
History | |||
---|---|---|---|
Date | User | Action | Args |
2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
2003-04-25 00:00:00 | admin | set | status: dr -> wp |
2002-05-10 00:00:00 | admin | set | messages: + msg660 |
2001-11-09 00:00:00 | admin | set | status: ready -> dr |
2001-05-20 00:00:00 | admin | set | messages: + msg473 |
2001-05-20 00:00:00 | admin | set | status: review -> ready |
2000-11-18 00:00:00 | admin | set | status: open -> review |
1999-07-14 00:00:00 | admin | create |