http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55245
--- Comment #2 from davidxl xinliangli at gmail dot com 2012-11-09 06:05:43
UTC ---
(In reply to comment #1)
The problem actually exists in main line compiler too.
This is another test case.
Segfaults without option, but builds ok with -DOK.
The problem seems to be that the main variant of the array type
Vector2float[2] does not have size, while the variant Vector2_f[2] has. The
variant's size later gets reset to 0 (from main variant).
David
template typename VType class Vector2 {
public:
Vector2();
VType x() const;
};
typedef Vector2float Vector2_f;
void GetR(const Vector2_f mosaic_position[3]);
template class C struct DefaultDeleter {
float GetColorTexCoord(Vector2_f tex_coord) const {
return tex_coord.x();
}
};
class GetT { private: virtual void TestBody(); };
void GetT::TestBody() {
#ifdef OK
Vector2float mosaic_position[2][3] = { };
#else
Vector2_f mosaic_position[2][3] = { };
#endif
}