This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48268] New: Incomplete Type (seems auto/c++0x specific)
- From: "dtag00 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Mar 2011 08:53:33 -0000
- Subject: [Bug c++/48268] New: Incomplete Type (seems auto/c++0x specific)
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48268
Summary: Incomplete Type (seems auto/c++0x specific)
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dtag00@gmail.com
Hi,
the following program yields an incomplete type error on GCC 4.5.1 in the
highlighted line "auto x=...". That shouldn't be the case right? It compiles
fine in the comeau online compiler.
I am compiling with
$ g++ a.cpp -std=gnu++0x
Error Message:
a.cpp: In function âint main()â:
a.cpp:14: error: âxâ has incomplete type
--------------
struct Foo
{
template<typename T>
static T add(T a, T b)
{
return a+b;
}
};
typedef double (*padd)(double, double);
int main()
{
auto x=&Foo::add<double>; // yields incomplete type on gcc, works on comeau
online
padd y=&Foo::add<double>; // works on both
}
--------------
Thanks