public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44524] New: improve diagnostic for . vs -> typo
@ 2010-06-13 14:05 manu at gcc dot gnu dot org
2010-06-13 17:28 ` [Bug c++/44524] " pinskia at gcc dot gnu dot org
2010-08-16 19:12 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 6+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-06-13 14:05 UTC (permalink / raw)
To: gcc-bugs
Testcase:
#include <map>
int bar(std::map<int, float> *X) {
return X.empty();
}
gcc-4.6:
/home/manuel/test/src/gcc/testsuite/g++.dg/warn/clang-11.C: In function 'int
bar(std::map<int, float>*)':^M
/home/manuel/test/src/gcc/testsuite/g++.dg/warn/clang-11.C:4:12: error: request
for member 'empty' in 'X', which is of non-class type 'std::map<int, float>*'
clang:
t.cc:4:11: error: member reference type 'std::map<int, float> *' is a pointer;
maybe you meant to use '->'?
return X.empty();
~^
->
In GCC, we would need to mention X and empty somewhere in addition to the type.
I would suggest:
error: request for member 'empty' in 'X', which has pointer type 'std::map<int,
float> *' ; maybe you meant to use '->'
--
Summary: improve diagnostic for . vs -> typo
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: manu at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44524
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44524] improve diagnostic for . vs -> typo
2010-06-13 14:05 [Bug c++/44524] New: improve diagnostic for . vs -> typo manu at gcc dot gnu dot org
@ 2010-06-13 17:28 ` pinskia at gcc dot gnu dot org
2010-08-16 19:12 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-06-13 17:28 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44524
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44524] improve diagnostic for . vs -> typo
2010-06-13 14:05 [Bug c++/44524] New: improve diagnostic for . vs -> typo manu at gcc dot gnu dot org
2010-06-13 17:28 ` [Bug c++/44524] " pinskia at gcc dot gnu dot org
@ 2010-08-16 19:12 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-08-16 19:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2010-08-16 19:12 -------
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-08-16 19:12:27
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44524
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44524] improve diagnostic for . vs -> typo
[not found] <bug-44524-4@http.gcc.gnu.org/bugzilla/>
2011-10-17 12:25 ` paolo.carlini at oracle dot com
2011-10-17 17:51 ` paolo at gcc dot gnu.org
@ 2011-10-17 17:52 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-17 17:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44524
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.7.0
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-17 17:52:27 UTC ---
Done for 4.7.0.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44524] improve diagnostic for . vs -> typo
[not found] <bug-44524-4@http.gcc.gnu.org/bugzilla/>
2011-10-17 12:25 ` paolo.carlini at oracle dot com
@ 2011-10-17 17:51 ` paolo at gcc dot gnu.org
2011-10-17 17:52 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2011-10-17 17:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44524
--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-10-17 17:51:04 UTC ---
Author: paolo
Date: Mon Oct 17 17:51:00 2011
New Revision: 180103
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180103
Log:
/cp
2011-10-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/44524
* typeck.c (build_class_member_access_expr): Provide a better error
message for X.Y where X is a pointer to class type.
(finish_class_member_access_expr): Likewise.
/testsuite
2011-10-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/44524
* g++.dg/parse/error41.C: New.
* g++.dg/parse/error20.C: Adjust.
Added:
trunk/gcc/testsuite/g++.dg/parse/error41.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/parse/error20.C
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44524] improve diagnostic for . vs -> typo
[not found] <bug-44524-4@http.gcc.gnu.org/bugzilla/>
@ 2011-10-17 12:25 ` paolo.carlini at oracle dot com
2011-10-17 17:51 ` paolo at gcc dot gnu.org
2011-10-17 17:52 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-17 12:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44524
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC|gcc-bugs at gcc dot gnu.org |
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-17 12:23:23 UTC ---
Seems doable.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-10-17 17:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-13 14:05 [Bug c++/44524] New: improve diagnostic for . vs -> typo manu at gcc dot gnu dot org
2010-06-13 17:28 ` [Bug c++/44524] " pinskia at gcc dot gnu dot org
2010-08-16 19:12 ` pinskia at gcc dot gnu dot org
[not found] <bug-44524-4@http.gcc.gnu.org/bugzilla/>
2011-10-17 12:25 ` paolo.carlini at oracle dot com
2011-10-17 17:51 ` paolo at gcc dot gnu.org
2011-10-17 17:52 ` paolo.carlini at oracle dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).