https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96251
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Iain D Sandoe <ia...@gcc.gnu.org>: https://gcc.gnu.org/g:0b0a579191828727c232d26b513e3f4d9eeb9b3d commit r10-9504-g0b0a579191828727c232d26b513e3f4d9eeb9b3d Author: Iain Sandoe <i...@sandoe.co.uk> Date: Tue Feb 23 12:54:26 2021 +0000 coroutines : Adjust error handling for type-dependent coroutines [PR96251]. Although coroutines are not permitted to be constexpr, generic lambdas are implicitly from C++17 and, because of this, a generic coroutine lambda can be marked as potentially constexpr. As per the PR, this then fails when type substitution is attempted because the check disallowing constexpr in the coroutines code was overly restrictive. This changes the error handing to mark the function as 'invalid_constexpr' but suppresses the error in the case that we are instantiating a constexpr. gcc/cp/ChangeLog: PR c++/96251 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress error reporting when instantiating for a constexpr. gcc/testsuite/ChangeLog: PR c++/96251 * g++.dg/coroutines/pr96251.C: New test. (cherry picked from commit f13d9e48eeca7ed8f8df55c9a62fc9980d5606ad)