J
Johannes Schaub (litb)
Both gcc and clang do not instantiate the struct definition. But comeau does
template <typename T>
void f()
{
struct haha {
void g() { T t; }
};
}
int main() {
f<void>();
}
And comeau therefor says "T t;" is invalid because t is void. I always
thought that local structs are immediately instantiated along with their
function. But clang and GCC don't do so!
Is GCC/Clang or Comeau correct? I deeply believe GCC and Clang are wrong on
this!
template <typename T>
void f()
{
struct haha {
void g() { T t; }
};
}
int main() {
f<void>();
}
And comeau therefor says "T t;" is invalid because t is void. I always
thought that local structs are immediately instantiated along with their
function. But clang and GCC don't do so!
Is GCC/Clang or Comeau correct? I deeply believe GCC and Clang are wrong on
this!