public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/99614] New: diagnostic-manager.cc:85: possible missing copy constructor ?
@ 2021-03-16 11:14 dcb314 at hotmail dot com
  2021-03-16 11:39 ` [Bug analyzer/99614] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dcb314 at hotmail dot com @ 2021-03-16 11:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99614

            Bug ID: 99614
           Summary: diagnostic-manager.cc:85: possible missing copy
                    constructor ?
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

>From this morning's static check of the source code of gcc:

trunk.git/gcc/analyzer/diagnostic-manager.cc:85:7: warning: Class
'epath_finder' does not have a copy constructor which is recommended since it
has dynamic memory/resource allocation(s). [noCopyConstructor]
trunk.git/gcc/analyzer/diagnostic-manager.cc:85:7: warning: Class
'epath_finder' does not have a operator= which is recommended since it has
dynamic memory/resource allocation(s). [noOperatorEq]

Class epath_finder has constructor and destructor, but neither
copy constructor nor operator =. This is not standard practice in C++.

Further advice sought.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug analyzer/99614] diagnostic-manager.cc:85: possible missing copy constructor ?
  2021-03-16 11:14 [Bug analyzer/99614] New: diagnostic-manager.cc:85: possible missing copy constructor ? dcb314 at hotmail dot com
@ 2021-03-16 11:39 ` rguenth at gcc dot gnu.org
  2021-03-16 12:13 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-16 11:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99614

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |11.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Guess they could be deleted instead if the object is never copied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug analyzer/99614] diagnostic-manager.cc:85: possible missing copy constructor ?
  2021-03-16 11:14 [Bug analyzer/99614] New: diagnostic-manager.cc:85: possible missing copy constructor ? dcb314 at hotmail dot com
  2021-03-16 11:39 ` [Bug analyzer/99614] " rguenth at gcc dot gnu.org
@ 2021-03-16 12:13 ` redi at gcc dot gnu.org
  2021-03-19  1:24 ` dmalcolm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2021-03-16 12:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99614

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-03-16

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It has a reference member, so its assignment operator is already deleted, so
cppcheck is wrong to warn about that.

It should have a user-declared (possibly deleted) copy constructor though.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug analyzer/99614] diagnostic-manager.cc:85: possible missing copy constructor ?
  2021-03-16 11:14 [Bug analyzer/99614] New: diagnostic-manager.cc:85: possible missing copy constructor ? dcb314 at hotmail dot com
  2021-03-16 11:39 ` [Bug analyzer/99614] " rguenth at gcc dot gnu.org
  2021-03-16 12:13 ` redi at gcc dot gnu.org
@ 2021-03-19  1:24 ` dmalcolm at gcc dot gnu.org
  2021-03-19 13:04 ` cvs-commit at gcc dot gnu.org
  2021-03-19 13:09 ` dmalcolm at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-03-19  1:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99614

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Working on a fix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug analyzer/99614] diagnostic-manager.cc:85: possible missing copy constructor ?
  2021-03-16 11:14 [Bug analyzer/99614] New: diagnostic-manager.cc:85: possible missing copy constructor ? dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2021-03-19  1:24 ` dmalcolm at gcc dot gnu.org
@ 2021-03-19 13:04 ` cvs-commit at gcc dot gnu.org
  2021-03-19 13:09 ` dmalcolm at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-19 13:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99614

--- 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:21d09cb732dac5d980ac628eb3aca75c821028a2

commit r11-7734-g21d09cb732dac5d980ac628eb3aca75c821028a2
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Fri Mar 19 09:01:57 2021 -0400

    analyzer: mark epath_finder with DISABLE_COPY_AND_ASSIGN [PR99614]

    cppcheck warns that class epath_finder does dynamic memory allocation, but
    is missing a copy constructor and operator=.

    This class isn't meant to be copied or assigned, so mark it with
    DISABLE_COPY_AND_ASSIGN.

    gcc/analyzer/ChangeLog:
            PR analyzer/99614
            * diagnostic-manager.cc (class epath_finder): Add
            DISABLE_COPY_AND_ASSIGN.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug analyzer/99614] diagnostic-manager.cc:85: possible missing copy constructor ?
  2021-03-16 11:14 [Bug analyzer/99614] New: diagnostic-manager.cc:85: possible missing copy constructor ? dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2021-03-19 13:04 ` cvs-commit at gcc dot gnu.org
@ 2021-03-19 13:09 ` dmalcolm at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-03-19 13:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99614

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- 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:[~2021-03-19 13:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 11:14 [Bug analyzer/99614] New: diagnostic-manager.cc:85: possible missing copy constructor ? dcb314 at hotmail dot com
2021-03-16 11:39 ` [Bug analyzer/99614] " rguenth at gcc dot gnu.org
2021-03-16 12:13 ` redi at gcc dot gnu.org
2021-03-19  1:24 ` dmalcolm at gcc dot gnu.org
2021-03-19 13:04 ` cvs-commit at gcc dot gnu.org
2021-03-19 13:09 ` 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).