https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61636
--- Comment #27 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Author: mpolacek Date: Tue Mar 14 16:03:10 2017 New Revision: 246134 URL: https://gcc.gnu.org/viewcvs?rev=246134&root=gcc&view=rev Log: PR c++/79264 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs. * semantics.c (finish_member_declaration): Assert class is being defined. * g++.dg/cpp1y/pr61636-1.C: Augment. PR c++/61636 * cp-tree.h (maybe_generic_this_capture): Declare. * lambda.c (resolvable_dummy_lambda): New, broken out of ... (maybe_resolve_dummy): ... here. Call it. (maybe_generic_this_capture): New. * parser.c (cp_parser_postfix_expression): Speculatively capture this in generic lambda in unresolved member function call. * pt.c (tsubst_copy_and_build): Force hard error from failed member function lookup in generic lambda. * g++.dg/cpp1y/pr61636-1.C: New. * g++.dg/cpp1y/pr61636-2.C: New. * g++.dg/cpp1y/pr61636-3.C: New. Added: branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp1y/pr61636-1.C branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp1y/pr61636-2.C branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp1y/pr61636-3.C Modified: branches/gcc-6-branch/gcc/cp/ChangeLog branches/gcc-6-branch/gcc/cp/cp-tree.h branches/gcc-6-branch/gcc/cp/lambda.c branches/gcc-6-branch/gcc/cp/parser.c branches/gcc-6-branch/gcc/cp/pt.c branches/gcc-6-branch/gcc/cp/semantics.c branches/gcc-6-branch/gcc/testsuite/ChangeLog