public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/91134] Confusing error message: error: ‘*server’ is a pointer; did you mean to use ‘->’? when -> is used
[not found] <bug-91134-4@http.gcc.gnu.org/bugzilla/>
@ 2022-05-23 18:39 ` jakub at gcc dot gnu.org
2022-05-25 12:22 ` cvs-commit at gcc dot gnu.org
2022-05-25 12:29 ` jakub at gcc dot gnu.org
2 siblings, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-23 18:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91134
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 53021
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53021&action=edit
gcc13-pr91134.patch
Untested fix (for C FE only so far).
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/91134] Confusing error message: error: ‘*server’ is a pointer; did you mean to use ‘->’? when -> is used
[not found] <bug-91134-4@http.gcc.gnu.org/bugzilla/>
2022-05-23 18:39 ` [Bug c/91134] Confusing error message: error: ‘*server’ is a pointer; did you mean to use ‘->’? when -> is used jakub at gcc dot gnu.org
@ 2022-05-25 12:22 ` cvs-commit at gcc dot gnu.org
2022-05-25 12:29 ` jakub at gcc dot gnu.org
2 siblings, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-25 12:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91134
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:7a3ee77a2e33b8b8ad31aea27996ebe92a5c8d83
commit r13-759-g7a3ee77a2e33b8b8ad31aea27996ebe92a5c8d83
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed May 25 14:21:54 2022 +0200
c: Improve build_component_ref diagnostics [PR91134]
On the following testcase (the first dg-error line) we emit a weird
diagnostics and even fixit on pointerpointer->member
where pointerpointer is pointer to pointer to struct and we say
'pointerpointer' is a pointer; did you mean to use '->'?
The first part is indeed true, but suggesting -> when the code already
does use -> is confusing.
The following patch adjusts callers so that they tell it if it is from
. parsing or from -> parsing and in the latter case suggests to dereference
the left operand instead by adding (* before it and ) after it (before ->).
Or would a suggestion to add [0] before -> be better?
2022-05-25 Jakub Jelinek <jakub@redhat.com>
PR c/91134
gcc/c/
* c-tree.h (build_component_ref): Add ARROW_LOC location_t
argument.
* c-typeck.cc (build_component_ref): Likewise. If DATUM is
INDIRECT_REF and ARROW_LOC isn't UNKNOWN_LOCATION, print a
different
diagnostic and fixit hint if DATUM has pointer type.
* c-parser.cc (c_parser_postfix_expression,
c_parser_omp_variable_list): Adjust build_component_ref callers.
* gimple-parser.cc
(c_parser_gimple_postfix_expression_after_primary):
Likewise.
gcc/objc/
* objc-act.cc (objc_build_component_ref): Adjust
build_component_ref
caller.
gcc/testsuite/
* gcc.dg/pr91134.c: New test.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/91134] Confusing error message: error: ‘*server’ is a pointer; did you mean to use ‘->’? when -> is used
[not found] <bug-91134-4@http.gcc.gnu.org/bugzilla/>
2022-05-23 18:39 ` [Bug c/91134] Confusing error message: error: ‘*server’ is a pointer; did you mean to use ‘->’? when -> is used jakub at gcc dot gnu.org
2022-05-25 12:22 ` cvs-commit at gcc dot gnu.org
@ 2022-05-25 12:29 ` jakub at gcc dot gnu.org
2 siblings, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-25 12:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91134
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for GCC 13.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-25 12:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-91134-4@http.gcc.gnu.org/bugzilla/>
2022-05-23 18:39 ` [Bug c/91134] Confusing error message: error: ‘*server’ is a pointer; did you mean to use ‘->’? when -> is used jakub at gcc dot gnu.org
2022-05-25 12:22 ` cvs-commit at gcc dot gnu.org
2022-05-25 12:29 ` jakub at gcc dot gnu.org
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).