This is the mail archive of the 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]

c++/9851: confusing error message when using '.', not '->'

>Number:         9851
>Category:       c++
>Synopsis:       confusing error message when using '.', not '->'
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 25 19:56:00 UTC 2003
>Originator:     Jeffrey D. Oldham
>Release:        3.4 20030224 (experimental)
not applicable
The C++ parser produces confusing error messages when trying to erroneously call a member function using the dot operator rather than the correct arrow operator.

For example, g_.do_nothing() causes these error messages: In constructor `foo::foo()': error: expected type-name error: expected `::' error: expected `~' error: expected identifier

g++ 2.96 produces intelligible error messages: In method `foo::foo ()': request for member `do_nothing' in `this->foo::g_', which is of non-aggregate type `goo *'
g++ -c

Content-Type: application/octet-stream; name=""
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=""


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