<div dir="ltr">gcc accepts the following, but clang does not:<div><br></div><div>template <typename T></div><div>class Container {</div><div>  class iterator;</div><div><br></div><div>  void method(iterator);</div><div><br></div><div>  void convenienceMethod(iterator n) { method(++n); }</div><div>}</div><div><br></div><div>Clang says that Container::iterator is an incomplete type. The situation seems similar to this: <a href="http://clang.llvm.org/compatibility.html#undep_incomplete">http://clang.llvm.org/compatibility.html#undep_incomplete</a></div><div><br></div><div>except in this case, the type is nested inside the template, which I had hoped would make the method body be ignored until instantiation (as in gcc).<br><br>My understanding is that since Container::iterator is part of the current instantiation, it is not considered a dependent type, so clang is correct by temp.res 8.5.1 and I should not open a bug report.</div><div><br></div><div>...but this is nice syntax when implementing containers, so I hope I am wrong.</div><div><br>Thanks,<br>Ken</div></div>