This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12774] New: Type checking problems in templates
- From: "roger at eyesopen dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Oct 2003 21:21:51 -0000
- Subject: [Bug c++/12774] New: Type checking problems in templates
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12774
Summary: Type checking problems in templates
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: roger at eyesopen dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu
The following example code demonstrates a mainline regression from atleast 3.2.x.
void Foo(double r[3][3])
{
}
void Baz()
{
double m[3][3];
Foo(m);
}
template <class T>
void Bar()
{
double m[3][3];
Foo(m);
}
int main()
{
Baz();
Bar<int>();
return 0;
}
This example contains two seemling identical calls to Foo. The first from
a normal function, Baz, compiles without a problem, the second call from
within a template, Bar, however results in the error message:
bob.cpp: In function `void Bar()':
bob.cpp:15: error: cannot convert `double (*)[3]' to `double (*)[3]' in argument
passing
This is with 3.4 20031024 (experimental) with or without any additional flags.