public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30836]  New: template T[] doesn't catch T[5]
@ 2007-02-17 17:49 igodard at pacbell dot net
  2007-02-17 19:11 ` [Bug c++/30836] " igodard at pacbell dot net
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: igodard at pacbell dot net @ 2007-02-17 17:49 UTC (permalink / raw)
  To: gcc-bugs

The code:
#include <iostream>

template<typename T> struct foo {
static const int i = 0; };
template<>
template<typename U> struct foo<U[]> {
static const int i = 1; };

int main() {
    int v[5];
    std::cerr << foo<int[5]>::i << ":" <<  foo<int[]>::i << "\n";
    return 0;
    }


prints:
0:1

which shows that int[5] is not caught by a T[] specialization. This may be the
standard, but I'm not sure and submit it anyway in case it's a bug.


-- 
           Summary: template T[] doesn't catch T[5]
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30836


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-06  9:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-17 17:49 [Bug c++/30836] New: template T[] doesn't catch T[5] igodard at pacbell dot net
2007-02-17 19:11 ` [Bug c++/30836] " igodard at pacbell dot net
2007-04-09 17:45 ` reichelt at gcc dot gnu dot org
2007-08-06  9:13 ` pcarlini at suse dot de

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).