This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r269972 - in /trunk/gcc: cp/ChangeLog cp/parser...
- From: jason at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 27 Mar 2019 18:39:21 -0000
- Subject: r269972 - in /trunk/gcc: cp/ChangeLog cp/parser...
Author: jason
Date: Wed Mar 27 18:39:20 2019
New Revision: 269972
URL: https://gcc.gnu.org/viewcvs?rev=269972&root=gcc&view=rev
Log:
PR c++/89241 - ICE with lambda in template parameter list.
We were getting confused by a lambda in template definition context that
isn't actually in the scope of any templated entity. Fixed by telling
type_dependent_expression_p that such a lambda is type-dependent even if we
can't tell that from its closure type. I've also restored the error for
defining a non-lambda class in a default template argument, and for a lambda
befor C++20.
* parser.c (cp_parser_lambda_expression): Also reject a lambda in a
template parameter list before C++20.
* pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
* semantics.c (begin_class_definition): Restore error about defining
non-lambda class in template parm list.
Added:
trunk/gcc/testsuite/g++.dg/cpp2a/lambda-uneval10.C
trunk/gcc/testsuite/g++.dg/ext/complit16.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c