This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12774] New: Type checking problems in templates


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]