------- Comment #5 from pinskia at gcc dot gnu dot org 2006-09-19 04:06 ------- So GCC does not implement 14.6.4.2/1, part 1: - For the part of look using unqualified name lookup (3.4.1), only function declareations with external linkage from the template context are found.
And since ADL on fundalment types not exist, that is the only part that happens so this is invalid code based on that and nothing else. Next time becareful when trying to figuring out why something is invalid code because it is easy to get it wrong and then have a someone else having to look at the standard to prove you wrong. In fact the following is valid code because of ADL (since template instantiation conext is also included for ADL): template<class T> int t(T i) { return f (i); // error: f not visible here } struct a{}; int f (a i) { return 0; } int main() { a b; return t(b); } -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2006-09-19 04:06:38 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131