public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* ISO_IEC_14882-2011-5.1.2/10 - bug
@ 2011-10-15 21:52 niXman
  2011-10-15 22:42 ` Paolo Carlini
  0 siblings, 1 reply; 2+ messages in thread
From: niXman @ 2011-10-15 21:52 UTC (permalink / raw)
  To: gcc

Hello.

Quote from ISO_IEC_14882-2011, 5.1.2/10:
> The identifiers in a capture-list are looked up using the usual rules for unqualified name lookup (3.4.1); each
> such lookup shall find a variable with automatic storage duration declared in the reaching scope of the local
> lambda expression. An entity (i.e. a variable or this) is said to be explicitly captured if it appears in the
> lambda-expression’s capture-list.

But this code successfuly compiled on gcc-4.6.1:
#include <iostream>
int main() {
   using std::cout;
   auto f = [&cout]() { cout << 1; }; // <<
   f();
}

http://liveworkspace.org/code/ae698b7daf7b5b531beafd9faaa6a409


But Intel C++ 12.1 says: error : a variable with static storage
duration cannot be captured in a lambda


Thanks.
   niXman.

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

* Re: ISO_IEC_14882-2011-5.1.2/10 - bug
  2011-10-15 21:52 ISO_IEC_14882-2011-5.1.2/10 - bug niXman
@ 2011-10-15 22:42 ` Paolo Carlini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Carlini @ 2011-10-15 22:42 UTC (permalink / raw)
  To: niXman; +Cc: gcc

Hi

> Hello.
> 
> Quote from ISO_IEC_14882-2011, 5.1.2/10:

Please open a normal Bugzilla PR

Thanks,
Paolo

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

end of thread, other threads:[~2011-10-15  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-15 21:52 ISO_IEC_14882-2011-5.1.2/10 - bug niXman
2011-10-15 22:42 ` Paolo Carlini

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