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: [email protected]
        ReportedBy: [email protected]


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

Reply via email to