Testcase:

struct A { void f(); };
void g() { A().f.a; }

GCC 3.4 and 4.0 display the following error message:

    a.cpp:2: error: insufficient contextual information to determine type

This message is surprising, because, whatever the context, a compiler will
never be able to do anything useful with "member-function dot something". It
would be less misleading if GCC was outputting something like:

    a.cpp:2: error: request for member `a' in `A().f', which is of non-class
type `void ()()'

The error message of GCC 3.3 was clearer:

    a.cpp:2: error: invalid use of member (did you forget the `&' ?)

In fact, newer GCCs display this same error message if the dot is replaced by
an arrow.


-- 
           Summary: "insufficient contextual information to determine type"
                    is not a helpful error message
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: guillaume dot melquiond at ens-lyon dot fr


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

Reply via email to