From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 419213858C48; Fri, 24 May 2024 14:20:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 419213858C48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716560401; bh=cHPPkMXHZWrGRmwin9Mmzjjldytaod08Yn6Ph6pnWdc=; h=From:To:Subject:Date:From; b=XxK+2Or/nv8csOpCzcrLzQhSFp8F9Ucq5T2ukM3JiQdNhVx0vh6QnGjP5lBRWAUSE 319GoR+78hGvxjGypghVX8875Bh++cga3Yc17c6v2Rhj2eqClF1fgMjnoCm630RZCF x47sfC4kbKEVjQq1rsU9AgGP8McLZJ4LAKzMjhAo= From: "olaf.krzikalla at dlr dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/115216] New: operator auto() gets instantiatied too eagerly Date: Fri, 24 May 2024 14:20:00 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olaf.krzikalla at dlr dot de 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115216 Bug ID: 115216 Summary: operator auto() gets instantiatied too eagerly Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: olaf.krzikalla at dlr dot de Target Milestone: --- Full example in: https://godbolt.org/z/3hG5fh1PW The example can be compiled either by commenting out line 24 or by swapping= in line 8 for line 9. In any case line 25 works. Thus there is a difference between the terms "xx[1]" and "xx.operator[](1)". The error occurs with all recent gcc versions. It doesn't occur with any cl= ang version.=