public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/97116] New: Fix argument numbering in C++ member function calls
@ 2020-09-18 14:19 dmalcolm at gcc dot gnu.org
2020-10-06 21:53 ` [Bug analyzer/97116] " dmalcolm at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-09-18 14:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97116
Bug ID: 97116
Summary: Fix argument numbering in C++ member function calls
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: dmalcolm at gcc dot gnu.org
Blocks: 97110
Target Milestone: ---
IIRC -fanalyzer currently misreports parameter numbers in calls when there's an
implicit "this" pointer (e.g. when passing NULL as "this" due to a buggy
allocator to a ctor call it reports "parameter 1", rather than "this").
We might need a langhook for this (but what about LTO, and e.g. mixed-language
analysis?)
(Filing this as part of the -fanalyzer C++ tracker bug)
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97110
[Bug 97110] [meta-bug] tracker bug for supporting C++ in -fanalyzer
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug analyzer/97116] Fix argument numbering in C++ member function calls
2020-09-18 14:19 [Bug analyzer/97116] New: Fix argument numbering in C++ member function calls dmalcolm at gcc dot gnu.org
@ 2020-10-06 21:53 ` dmalcolm at gcc dot gnu.org
2020-10-06 21:55 ` dmalcolm at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-10-06 21:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97116
--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
The C++ FE has %P for printing parm indices, with index < 0 printed as "this";
implemented in cp/error.c: parm_to_string as called from cp_printer.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug analyzer/97116] Fix argument numbering in C++ member function calls
2020-09-18 14:19 [Bug analyzer/97116] New: Fix argument numbering in C++ member function calls dmalcolm at gcc dot gnu.org
2020-10-06 21:53 ` [Bug analyzer/97116] " dmalcolm at gcc dot gnu.org
@ 2020-10-06 21:55 ` dmalcolm at gcc dot gnu.org
2020-10-06 21:58 ` dmalcolm at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-10-06 21:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97116
--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(using "i - is_method" as the value)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug analyzer/97116] Fix argument numbering in C++ member function calls
2020-09-18 14:19 [Bug analyzer/97116] New: Fix argument numbering in C++ member function calls dmalcolm at gcc dot gnu.org
2020-10-06 21:53 ` [Bug analyzer/97116] " dmalcolm at gcc dot gnu.org
2020-10-06 21:55 ` dmalcolm at gcc dot gnu.org
@ 2020-10-06 21:58 ` dmalcolm at gcc dot gnu.org
2020-10-07 13:40 ` cvs-commit at gcc dot gnu.org
2020-10-07 13:48 ` dmalcolm at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-10-06 21:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97116
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
is_method seems to be set by:
if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
so perhaps we can simply reimplement this logic
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug analyzer/97116] Fix argument numbering in C++ member function calls
2020-09-18 14:19 [Bug analyzer/97116] New: Fix argument numbering in C++ member function calls dmalcolm at gcc dot gnu.org
` (2 preceding siblings ...)
2020-10-06 21:58 ` dmalcolm at gcc dot gnu.org
@ 2020-10-07 13:40 ` cvs-commit at gcc dot gnu.org
2020-10-07 13:48 ` dmalcolm at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-07 13:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97116
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:
https://gcc.gnu.org/g:2f7c50b7091c09d665aaf27173aacf34c9904e4c
commit r11-3701-g2f7c50b7091c09d665aaf27173aacf34c9904e4c
Author: David Malcolm <dmalcolm@redhat.com>
Date: Tue Oct 6 17:59:07 2020 -0400
analyzer: handle C++ argument numbers and "this" [PR97116]
gcc/analyzer/ChangeLog:
PR analyzer/97116
* sm-malloc.cc (method_p): New.
(describe_argument_index): New.
(inform_nonnull_attribute): Use describe_argument_index.
(possible_null_arg::describe_final_event): Likewise.
(null_arg::describe_final_event): Likewise.
gcc/testsuite/ChangeLog:
PR analyzer/97116
* g++.dg/analyzer/pr97116.C: New test.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug analyzer/97116] Fix argument numbering in C++ member function calls
2020-09-18 14:19 [Bug analyzer/97116] New: Fix argument numbering in C++ member function calls dmalcolm at gcc dot gnu.org
` (3 preceding siblings ...)
2020-10-07 13:40 ` cvs-commit at gcc dot gnu.org
@ 2020-10-07 13:48 ` dmalcolm at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-10-07 13:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97116
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #5 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Should be fixed by the above commit.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-10-07 13:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 14:19 [Bug analyzer/97116] New: Fix argument numbering in C++ member function calls dmalcolm at gcc dot gnu.org
2020-10-06 21:53 ` [Bug analyzer/97116] " dmalcolm at gcc dot gnu.org
2020-10-06 21:55 ` dmalcolm at gcc dot gnu.org
2020-10-06 21:58 ` dmalcolm at gcc dot gnu.org
2020-10-07 13:40 ` cvs-commit at gcc dot gnu.org
2020-10-07 13:48 ` dmalcolm 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).