This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/61133] New: g++ doesn't implement DR1760


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

            Bug ID: 61133
           Summary: g++ doesn't implement DR1760
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com

Testcase:

int main()
{
 auto x = [y = 5](){}; 
 auto z = x.y;
}

The member should not be usable. The most recent WP says
"An init-capture behaves as if it declares and explicitly captures a variable
of the form âauto init-capture ;â
whose declarative region is the lambda-expressionâs compound-statement"

and the previous WP said the name of the captured variable should be unique.
See http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1760

I think it was always the intent of captures (including init-captures) that
they do not behave like public members of a class.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]