From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5AF2F386F44C; Tue, 21 Apr 2020 23:21:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5AF2F386F44C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587511281; bh=UMjAgk9Ska3r8525MEo+/kGP0QyxFiRyxdcfy23kDIc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ySd5UJtVdrJAU37YwtNIG28V3vr/9x2B+iyc3GQOkDPqtYJyyxtRewHR5WKAVCEfI pnwvmbVY5Ezi6o/4sJkFRdGvxm5jB+AEQzECvJIq73iP0ZJleGFfsnbq5evrCf4NhD ySoeQxlAtMa6S8ZItpAM2po3Dj+uhm5M4tmgPb8c= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94645] [10 Regression][concepts] incorrect concept evaluation with decltype, plus internal error since r10-7554-gf1ad7bac76b66257 Date: Tue, 21 Apr 2020 23:21:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2020 23:21:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94645 --- Comment #9 from Patrick Palka --- Thanks for the reduced testcases. The problem in #c8 seems to start in grokfndecl() when processing the operator() of the lambda. During grokfndecl on the operator(), processing_template_decl is 1 but template_class_depth is 0 (seems it shoul= d be 1 here?). So the condition for 'memtmpl' in tree ctx =3D friendp ? current_class_type : ctype; bool memtmpl =3D (processing_template_decl > template_class_depth (ct= x)); is true for this non-templated lambda, but IIUC 'memtmpl' should be true on= ly if the declaration in question has its own set of template parameters, whic= h is not the case here. Since memtmpl is true, we then attach the innermost constraints (belonging = to struct l) to this non-templated operator() via: if (memtmpl) tmpl_reqs =3D TEMPLATE_PARMS_CONSTRAINTS (current_template_parms); tree ci =3D build_constraints (tmpl_reqs, decl_reqs); ... set_constraints (decl, ci); and thing goes downhill from there. I tried fixing template_class_depth to return 1 in this case via --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -390,7 +390,12 @@ template_class_depth (tree type) ++depth; if (DECL_P (type)) - type =3D CP_DECL_CONTEXT (type); + { + if (tree fctx =3D DECL_FRIEND_CONTEXT (type)) + type =3D fctx; + else + type =3D CP_DECL_CONTEXT (type); + } else if (LAMBDA_TYPE_P (type) && LAMBDA_TYPE_EXTRA_SCOPE (type)) type =3D LAMBDA_TYPE_EXTRA_SCOPE (type); else but this change causes a bunch of ICEs in the cmcstl2 testsuite. It seems that the condition for 'memtmpl' needs adjusting, but I'm not sure how.=