[Bug c++/48268] New: Incomplete Type (seems auto/c++0x specific)

dtag00 at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Mar 24 09:29:00 GMT 2011


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



More information about the Gcc-bugs mailing list