------- Additional Comments From sebor at roguewave dot com 2005-07-01 00:06 ------- Further, in response to comment 2 from bug 22263:
I agree that 14.7.2, p3 applies to that case but since the definition of class b is in scope at the point of the explicit instantiation of the class template I believe the test case is well-formed. The definition of a class template doesn't necessarily imply the definition of all its members, just their declaration. I don't see any practical difference between either of these cases and the case of explicitly instantiating a non-member function template which need only be declared but not necessarily defined at the point of the explicit instantiation. As an additional data point, the behavior implemented by all other compilers is to instantiate all members regardless of whether they are defined prior or after the directive. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22263