This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/5786: array template argument deduction from temporary
- From: david dot abrahams at rcn dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 26 Feb 2002 16:57:58 -0000
- Subject: c++/5786: array template argument deduction from temporary
- Reply-to: david dot abrahams at rcn dot com
>Number: 5786
>Category: c++
>Synopsis: array template argument deduction from temporary
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Feb 26 09:06:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: David Abrahams
>Release: 3.0.3
>Organization:
>Environment:
Cygwin
>Description:
Various kinds of array argument deduction from temporaries fails. Some fraction of this may be correct behavior; EDG rejects most of these, too.
-Dave
>How-To-Repeat:
Compile the following:
template <class T, unsigned N>
void print1(T const (&x)[N])
{
}
template <class T, unsigned N, unsigned M>
void print2(T const (&x)[N][M])
{
}
template <class T, unsigned N>
void print3(T const(*x)[N])
{
}
template <class T, unsigned N>
void print4(T (*x)[N])
{
}
struct X { int x[2][4]; };
int main()
{
print1(X().x);
print2(X().x);
print3(&X().x);
print4(&X().x);
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: