This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/34624] New: valid c++ code doesn't compile for x86_64, but for i386


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]