public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49326] New: Lambda arguments should not have a default value
@ 2011-06-08 16:41 vanboxem.ruben at gmail dot com
  2011-06-08 16:51 ` [Bug c++/49326] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vanboxem.ruben at gmail dot com @ 2011-06-08 16:41 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Lambda arguments should not have a default value
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vanboxem.ruben@gmail.com


Currently, GCC 4.6.1 warns in pedantic mode when a lambda is written that
provides  default value for an argument:

[](bool a, bool=true){ return !a;} }

Which, according to the FDIS n3290 section 5.1.2/5, should be illegal and thus
give an error. 


As the detection code is already present/functional (in -pedantic mode),
changing that into an error shouldn't be hard.


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

* [Bug c++/49326] Lambda arguments should not have a default value
  2011-06-08 16:41 [Bug c++/49326] New: Lambda arguments should not have a default value vanboxem.ruben at gmail dot com
@ 2011-06-08 16:51 ` redi at gcc dot gnu.org
  2011-06-08 16:55 ` vanboxem.ruben at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2011-06-08 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-08 16:50:42 UTC ---
If you get a warning with -pedantic that usually means it's a G++ extension.

If you don't want the extension use -pedantic-errors so it is rejected


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

* [Bug c++/49326] Lambda arguments should not have a default value
  2011-06-08 16:41 [Bug c++/49326] New: Lambda arguments should not have a default value vanboxem.ruben at gmail dot com
  2011-06-08 16:51 ` [Bug c++/49326] " redi at gcc dot gnu.org
@ 2011-06-08 16:55 ` vanboxem.ruben at gmail dot com
  2011-06-08 17:05 ` redi at gcc dot gnu.org
  2011-06-08 17:49 ` vanboxem.ruben at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: vanboxem.ruben at gmail dot com @ 2011-06-08 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Ruben Van Boxem <vanboxem.ruben at gmail dot com> 2011-06-08 16:54:34 UTC ---
I compiled with -std=c++0x, so GCC extensions should be turned off.


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

* [Bug c++/49326] Lambda arguments should not have a default value
  2011-06-08 16:41 [Bug c++/49326] New: Lambda arguments should not have a default value vanboxem.ruben at gmail dot com
  2011-06-08 16:51 ` [Bug c++/49326] " redi at gcc dot gnu.org
  2011-06-08 16:55 ` vanboxem.ruben at gmail dot com
@ 2011-06-08 17:05 ` redi at gcc dot gnu.org
  2011-06-08 17:49 ` vanboxem.ruben at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2011-06-08 17:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-08 17:05:06 UTC ---
No, that's not how it works, read the manual for -std and -pedantic.


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

* [Bug c++/49326] Lambda arguments should not have a default value
  2011-06-08 16:41 [Bug c++/49326] New: Lambda arguments should not have a default value vanboxem.ruben at gmail dot com
                   ` (2 preceding siblings ...)
  2011-06-08 17:05 ` redi at gcc dot gnu.org
@ 2011-06-08 17:49 ` vanboxem.ruben at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: vanboxem.ruben at gmail dot com @ 2011-06-08 17:49 UTC (permalink / raw)
  To: gcc-bugs

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

Ruben Van Boxem <vanboxem.ruben at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #4 from Ruben Van Boxem <vanboxem.ruben at gmail dot com> 2011-06-08 17:48:53 UTC ---
Ok, my mistake, I compiled with -std=c++0x -pedantic, which (as I'm reading in
the manual now) turns off GCC extensions and makes  program adhere to strict
standards... But emits warnings only. I should use -pedantic-errors then. OK.
That works as it should in this case. Thanks.


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

end of thread, other threads:[~2011-06-08 17:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-08 16:41 [Bug c++/49326] New: Lambda arguments should not have a default value vanboxem.ruben at gmail dot com
2011-06-08 16:51 ` [Bug c++/49326] " redi at gcc dot gnu.org
2011-06-08 16:55 ` vanboxem.ruben at gmail dot com
2011-06-08 17:05 ` redi at gcc dot gnu.org
2011-06-08 17:49 ` vanboxem.ruben at gmail dot com

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