public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66543] New: False positive warning "variable set but not used"
@ 2015-06-15 13:34 ldionne.2 at gmail dot com
  2015-06-18  8:54 ` [Bug c++/66543] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: ldionne.2 at gmail dot com @ 2015-06-15 13:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66543
           Summary: False positive warning "variable set but not used"
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ldionne.2 at gmail dot com
  Target Milestone: ---

The following code triggers a "unused but set variable" warning on GCC trunk:

    int main() {
        auto f = []() { };
        [=](auto) {
            using Foo = decltype(f());
        };
    }

I think it is a false positive, since `f` is obviously used.

> g++ --version
g++ (GCC) 6.0.0 20150613 (experimental)

> g++ -std=c++14 worksheet.cpp -fsyntax-only -Wall -Wno-unused-local-typedefs

In function ‘int main()’:
warning: variable ‘f’ set but not used [-Wunused-but-set-variable]
         auto f = []() { };
              ^

Regards,
Louis Dionne
>From gcc-bugs-return-489006-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jun 15 13:59:47 2015
Return-Path: <gcc-bugs-return-489006-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 32880 invoked by alias); 15 Jun 2015 13:59:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 32833 invoked by uid 48); 15 Jun 2015 13:59:43 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/66358] [5/6 Regression] [SH] ICE: in extract_constrain_insn, at recog.c:2232
Date: Mon, 15 Jun 2015 13:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.2
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66358-4-mBJOg9sq7u@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66358-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66358-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-06/txt/msg01338.txt.bz2
Content-length: 556

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf358

--- Comment #12 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to John Paul Adrian Glaubitz from comment #11)
> Any news on this issue? The sh4 buildds in Debian are currently building a
> snapshot as of 2015-06-13 (r224454), let's see how far it gets.

It will take a while to develop the R0 pre-allocating RTL pass as mentioned in
c#10.  Once this has been done and it's been stabilized it can be backported to
the GCC 5 release branch -- assuming that it will fix the R0 reload problems.


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

* [Bug c++/66543] False positive warning "variable set but not used"
  2015-06-15 13:34 [Bug c++/66543] New: False positive warning "variable set but not used" ldionne.2 at gmail dot com
@ 2015-06-18  8:54 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-06-18  8:54 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-06-18
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.


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

end of thread, other threads:[~2015-06-18  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-15 13:34 [Bug c++/66543] New: False positive warning "variable set but not used" ldionne.2 at gmail dot com
2015-06-18  8:54 ` [Bug c++/66543] " mpolacek 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).