public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34624]  New: valid c++ code doesn't compile for x86_64, but for i386
@ 2007-12-30 13:27 tim at klingt dot org
  2008-01-13  2:34 ` [Bug c++/34624] " bangerth at dealii dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: tim at klingt dot org @ 2007-12-30 13:27 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]

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


^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <bug-34624-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2013-08-01 10:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-30 13:27 [Bug c++/34624] New: valid c++ code doesn't compile for x86_64, but for i386 tim at klingt dot org
2008-01-13  2:34 ` [Bug c++/34624] " bangerth at dealii dot org
2008-01-13 13:03 ` tim at klingt dot org
2008-01-14  9:33 ` Ralf dot Wildenhues at gmx dot de
2008-01-14 11:18 ` rguenth at gcc dot gnu dot org
2008-09-22 12:12 ` tim at klingt dot org
2008-12-30  5:42 ` pinskia at gcc dot gnu dot org
2008-12-30 10:00 ` tim at klingt dot org
2008-12-30 10:00 ` tim at klingt dot org
2008-12-30 10:03 ` tim at klingt dot org
2008-12-30 17:29 ` [Bug c++/34624] templated code is rejected different type in nontype template argument pinskia at gcc dot gnu dot org
2008-12-30 17:31 ` pinskia at gcc dot gnu dot org
     [not found] <bug-34624-4@http.gcc.gnu.org/bugzilla/>
2013-08-01 10:43 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).