public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52281] New: No warnings generated for unused captures
@ 2012-02-16 15:38 bootsarehax at gmail dot com
  2012-02-20 21:43 ` [Bug c++/52281] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: bootsarehax at gmail dot com @ 2012-02-16 15:38 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52281
           Summary: No warnings generated for unused captures
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bootsarehax@gmail.com


I would expect the code:

int main()
{
  int i = 23;
  auto x = [&i]() {return 25;};
  x();
  return 0;
}

to issue a warning when compiled with -Wall -Wextra similar to unused
variables.

This seems similar to this:

struct foo {
  int operator()() { return 42;}
  int x;
};

gcc does not issue a warning here as well, although it might be useful.


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

* [Bug c++/52281] No warnings generated for unused captures
  2012-02-16 15:38 [Bug c++/52281] New: No warnings generated for unused captures bootsarehax at gmail dot com
@ 2012-02-20 21:43 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-20 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-20
     Ever Confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-20 21:42:11 UTC ---
Confirmed.


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

end of thread, other threads:[~2012-02-20 21:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16 15:38 [Bug c++/52281] New: No warnings generated for unused captures bootsarehax at gmail dot com
2012-02-20 21:43 ` [Bug c++/52281] " pinskia 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).