New bug or Bug 5786?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I hope this is the right list for this question.

I found a bug in g++ (gcc version 4.0.2 20050901 (prerelease) (SUSE
Linux)), and I don't know if it is new, and I should add it to bugzilla.
The failing code is

template<class T, int n>
 void foo(T (&)[n], T (&)[n])
{
}

template<class T, int n1, int n2>
 void foo(T (&)[n1][n2], T (&)[n1][n2])
{
}

int main()
{
  int a[2][2];
  foo(a, a);
}

and it gives the following error message:

arraybug.cc: In function ‘int main()’:
arraybug.cc:14: error: call of overloaded ‘foo(int [2][2], int [2][2])’
is ambiguous
arraybug.cc:2: note: candidates are: void foo(T (&)[n], T (&)[n]) [with
T = int [2], int n = 2]
arraybug.cc:7: note:                 void foo(T (&)[n1][n2], T
(&)[n1][n2]) [with T = int, int n1 = 2, int n2 = 2]

I've been searching the bug database, and found Bug 5786, of which I'm
however not sure if this is really the same bug. So should I report this
as new bug, or is it just Bug 5786 (or maybe another bug which I
overlooked?)

Thanks in advance.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux