From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4F5603858D35; Sat, 26 Sep 2020 15:38:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F5603858D35 From: "sfranzen85 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97214] New: ICE in lookup_template_class_1, at cp/pt.c:9896 Date: Sat, 26 Sep 2020 15:38:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sfranzen85 at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Sat, 26 Sep 2020 15:38:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97214 Bug ID: 97214 Summary: ICE in lookup_template_class_1, at cp/pt.c:9896 Product: gcc Version: 10.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sfranzen85 at hotmail dot com Target Milestone: --- The following snippet reproduces an error I encountered with lambdas: struct Foo { // void operator()(int) {} template void operator()(T, T) { auto bar =3D [this](auto&& v){ operator()(v); }; } }; int main () { Foo{}(0,1); return 0; } Full error: ../src/main.cpp: In instantiation of =E2=80=98void Foo::operator()(T, T) [w= ith T =3D int]=E2=80=99: ../src/main.cpp:13:14: required from here ../src/main.cpp:7:38: internal compiler error: in lookup_template_class_1, = at cp/pt.c:9896 7 | auto bar =3D [this](auto&& v){ operator()(v); }; | ^~~~~~~~~~ Further observations: * The error appears regardless of available operator()() overloads; * It only appears if the function call is unqualified, e.g. (*this)(v) is f= ine if the overload exists. A possibly related error is given using a version of Foo without a function template: struct Foo { void operator()(int) {} void operator()(int a, int) { auto bar =3D [this](auto&& v){ operator()(v); }; bar(a); } }; ../src/main.cpp: In instantiation of =E2=80=98Foo::operator()(int, int):: [with auto:1 =3D int&]=E2=80=99: ../src/main.cpp:8:14: required from here ../src/main.cpp:7:48: error: use of =E2=80=98Foo::operator()(int, int):: [with auto:1 =3D int&]=E2=80=99 before deduction o= f =E2=80=98auto=E2=80=99 7 | auto bar =3D [this](auto&& v){ operator()(v); }; | ~~~~~~~~~~^~~ This error similarly only appears with the unqualified call, and also disappears if the lambda has '-> void'.=