The program below demonstrates an incorrect error on an expression involving
operator().  The error incorrectly reported is "error: 'type name' declared as
function returning a function".

#include <stdio.h>

struct T {
        int operator()(int) const { printf("hello\n"); return 1; }
};

int main()
{
        if ( T()(int()) ) ; // OK, no error
        if ((T()(int()))) ; // incorrect error on this line
        return 0;
}


-- 
           Summary: "'type name' declared as function returning a function"
                    with operator()
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sc09q4 at bullseye dot com
  GCC host triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42034

Reply via email to