public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mckelvey at maskull dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/32089] Winline reports bogus warning
Date: Fri, 25 May 2007 23:03:00 -0000	[thread overview]
Message-ID: <20070525230317.8148.qmail@sourceware.org> (raw)
In-Reply-To: <bug-32089-6183@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from mckelvey at maskull dot com  2007-05-25 23:03 -------
Here is how I compile it:

/usr/local/bin/g++ -c -O3 -DNDEBUG -Wuninitialized -pedantic-errors -Werror 
-Winline -ansi -fno-common -Wall -Wold-style-cast -Wsign-promo -Wpointer-arith 
-Wundef -Wwrite-strings -Winvalid-pch -Woverloaded-virtual -Wcast-qual -Wextra 
-Wredundant-decls -Wshadow -Wcast-align -Wcomment -fstrict-aliasing 
-Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wlogical-op 
-Wunused -fvisibility-inlines-hidden -MMD      
-fimplicit-templates -o CircularlyReferenceable.o CircularlyReferenceable.cc

"froms" is the multiset. The destructor will be called in the normal case.
There
is an exception, but it is thrown before the multiset is even created.

        SeenMultiset froms;

        if (from != PDNULL)
        {
            froms.insert(from);
        }

        // Record we've been seen
        seen_map.insert(std::make_pair(this, froms));

        return true;

The warning points at the seen_map.insert and the return.

Whole member function:

bool CircularlyReferenceable::

_accumulate_delete_candidates(
    const CircularlyReferenceable * const from,
    SeenMap&                              seen_map) const
{
    if (! _is_allocated())
    {
        if (! get_strict())
        {
            return false;
        }

        throw InternalException(_message(_msgtext("Inconsistent reference "
                                                  "count: %s(0)::%s(1)"),
                                         name(),
                                         "_accumulate_delete_candidates"),
                                __FILE__,
                                __LINE__);
    }

    // Get our entry (if there is one)
    const SeenMap::iterator it(seen_map.find(this));

    if (it == seen_map.end())
    {
        // We haven't been seen before; make an entry

        SeenMultiset froms;

        if (from != PDNULL)
        {
            froms.insert(from);
        }

        // Record we've been seen
        seen_map.insert(std::make_pair(this, froms));

        return true;
    }

    // We have been seen before, update the set of pointers to us

    if (from != PDNULL)
    {
        it->second.insert(from);
    }

    return false;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32089


  parent reply	other threads:[~2007-05-25 23:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-25 22:27 [Bug c++/32089] New: " mckelvey at maskull dot com
2007-05-25 22:30 ` [Bug c++/32089] " pinskia at gcc dot gnu dot org
2007-05-25 23:03 ` mckelvey at maskull dot com [this message]
2007-06-10  3:24 ` pinskia at gcc dot gnu dot org
2007-06-10 22:52 ` mckelvey at maskull dot com
2007-07-13 15:28 ` James dot W dot Mckelvey at jpl dot nasa dot gov
2008-02-17 19:45 ` hubicka at gcc dot gnu dot org
2008-02-19  0:59 ` mckelvey at maskull dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070525230317.8148.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).