From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/g++.dg/torture/pr34222.C | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 gcc/testsuite/g++.dg/torture/pr34222.C (limited to 'gcc/testsuite/g++.dg/torture/pr34222.C') diff --git a/gcc/testsuite/g++.dg/torture/pr34222.C b/gcc/testsuite/g++.dg/torture/pr34222.C new file mode 100644 index 000000000..130896dc9 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr34222.C @@ -0,0 +1,65 @@ +/* { dg-do compile } */ + +namespace std __attribute__ ((__visibility__ ("default"))) { + template struct char_traits; + } +__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t; +namespace std __attribute__ ((__visibility__ ("default"))) { + typedef ptrdiff_t streamsize; + template > class basic_ifstream; + typedef basic_ifstream ifstream; + class ios_base { + }; + } +template class Vector4 { + public: + inline Vector4(); + inline Vector4(T, T, T, T); + T x, y, z, w; + }; +template class Matrix4 { + public: + Matrix4(const Vector4&, const Vector4&, const Vector4&, const Vector4&); + Matrix4(const Matrix4& m); + Vector4 r[4]; + }; +typedef Vector4 Vec4f; +typedef Matrix4 Mat4f; +template Vector4::Vector4() : x(0), y(0), z(0), w(0) { + } +template Vector4::Vector4(T _x, T _y, T _z, T _w) : x(_x), y(_y), z(_z), w(_w) { + } +template Matrix4::Matrix4(const Vector4& v0, const Vector4& v1, const Vector4& v2, const Vector4& v3) { + } +namespace std __attribute__ ((__visibility__ ("default"))) { + template class basic_ios : public ios_base { + }; + template class basic_istream : virtual public basic_ios<_CharT, _Traits> { + public: + typedef _CharT char_type; + typedef basic_istream<_CharT, _Traits> __istream_type; + __istream_type& read(char_type* __s, streamsize __n); + }; + template class basic_ifstream : public basic_istream<_CharT, _Traits> { + }; + } +using namespace std; +static float readFloat(ifstream& in) { + float f; + in.read((char*) &f, sizeof(float)); + } +Mat4f readMeshMatrix(ifstream& in, int nBytes) { + float m00 = readFloat(in); + float m01 = readFloat(in); + float m02 = readFloat(in); + float m10 = readFloat(in); + float m11 = readFloat(in); + float m12 = readFloat(in); + float m20 = readFloat(in); + float m21 = readFloat(in); + float m22 = readFloat(in); + float m30 = readFloat(in); + float m31 = readFloat(in); + float m32 = readFloat(in); + return Mat4f(Vec4f(m00, m01, m02, 0), Vec4f(m10, m11, m12, 0), Vec4f(m20, m21, m22, 0), Vec4f(m30, m31, m32, 1)); + } -- cgit v1.2.3