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++/48268] New: Incomplete Type (seems auto/c++0x specific)


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


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