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
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).