This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24560] New: "insufficient contextual information to determine type" is not a helpful error message
- From: "guillaume dot melquiond at ens-lyon dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Oct 2005 19:52:00 -0000
- Subject: [Bug c++/24560] New: "insufficient contextual information to determine type" is not a helpful error message
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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