the following code compiles on i386, but not for x86_64: [EMAIL PROTECTED]:~$ g++ -m32 bug.cpp [EMAIL PROTECTED]:~$ [EMAIL PROTECTED]:~$ g++ -m64 bug.cpp bug.cpp: In function âint main()â: bug.cpp:69: error: no matching function for call to âget_samples(my_table<float, 1024u>&)â [EMAIL PROTECTED]:~$
#include <boost/array.hpp> typedef unsigned int uint; template<typename sampletype, uint size> struct my_table: public boost::array<sampletype, size> {}; template<typename sampletype, uint size> inline const sampletype * get_samples(boost::array<sampletype, size> const & buffer) { return buffer.begin(); } int main() { my_table<float, 1024> tab; const float * ptr = get_samples(tab); } i could reproduce it with the debian packages of gcc-4.1 and 4.2 on i386 and amd64. best, tim -- Summary: valid c++ code doesn't compile for x86_64, but for i386 Product: gcc Version: 4.2.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tim at klingt dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34624