There is this code:
class A;
template
void fun() {
A a;
}
class A {
public:
A() { }
};
int main() {
fun();
return
Comeau's compiler does not like it either:
"ComeauTest.c", line 5: error: incomplete type is not allowed
A a;
^
However my attempts at finding chapter and verse in the C++ standard were fruitless. It seems hidden in between the lines and interactions of "point of instantiation", "name resolution". Paragraphs 14.6/8 and 14.6/9 of the 2003 standard seem relevant.