"Dependent names" (names used in templates whose meaning depends on the template parameters) are only resolved when the template is instantiated, not when it's defined. If you don't instantiate the template, then it can contain whatever crazy names you like, as long as it's syntactically correct.
Your program would fail to compile if it were instantiated:
list<int> l;
l.copyAll(l); // ERROR