This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34624] New: valid c++ code doesn't compile for x86_64, but for i386
- From: "tim at klingt dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Dec 2007 13:27:09 -0000
- Subject: [Bug c++/34624] New: valid c++ code doesn't compile for x86_64, but for i386
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
the following code compiles on i386, but not for x86_64:
tim@laptop:~$ g++ -m32 bug.cpp
tim@laptop:~$
tim@laptop:~$ 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>&)â??
tim@laptop:~$
#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