------- Comment #25 from jason at gcc dot gnu dot org 2009-03-20 18:11 ------- I don't think the testcase in comment #7 indicates a bug at all. We don't issue an error because we don't instantiate A<0>::i. 14.6 says:
If no valid specialization can be generated for a template definition, and that template is not instantiated, the template definition is ill-formed, no diagnostic required. If a type used in a non-dependent name is incomplete at the point at which a template is defined but is complete at the point at which an instantiation is done, and if the completeness of that type affects whether or not the program is well-formed or affects the semantics of the program, the program is ill-formed; no diagnostic is required. So no diagnostic is required. If we change the last line to int i = A<0>::i; we do instantiate A<0>::i, and we give the diagnostic. -- jason at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26266