Created attachment 37409 [details] Tarball with source (with comments), preprocessed source, and compiler output G++ erroneously fails to deduce the type of the `this` pointer inside a template-class member function when using init-capture to copy `this` into a lambda. My GCC version is 5.1.0 on an x86_64 architecture. My OS is Debian 8. More information, including a comparison to Clang++ and a list of variations that do or do not work, is available on this StackOverflow question: http://stackoverflow.com/q/34889310/1858225
Author: jason Date: Fri Jan 22 20:36:30 2016 New Revision: 232746 URL: https://gcc.gnu.org/viewcvs?rev=232746&root=gcc&view=rev Log: PR c++/69392 * lambda.c (lambda_capture_field_type): Handle 'this' specially for init-capture, too. Added: trunk/gcc/testsuite/g++.dg/cpp1y/lambda-init14.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/lambda.c
(In reply to Jason Merrill from comment #1) > Log: > PR c++/69392 > * lambda.c (lambda_capture_field_type): Handle 'this' specially > for init-capture, too. > What special handling is done for 'this'?
(In reply to Kyle J Strand from comment #2) > What special handling is done for 'this'? Basically, we treat it as non-dependent.