From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C5CD33857C58; Wed, 24 Nov 2021 09:38:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5CD33857C58 From: "enricomaria.dean6elis at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103403] New: Decltype of rvalue reference Date: Wed, 24 Nov 2021 09:38:44 +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: 11.2.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: enricomaria.dean6elis at gmail 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 keywords bug_severity priority component assigned_to reporter cc 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: Wed, 24 Nov 2021 09:38:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103403 Bug ID: 103403 Summary: Decltype of rvalue reference Product: gcc Version: 11.2.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: enricomaria.dean6elis at gmail dot com CC: anders.granlund.0 at gmail dot com, daniel.kruegler at googlemail dot com, jason at gcc dot= gnu.org, mpolacek at gcc dot gnu.org, trippels at gcc dot gnu.or= g, webrown.cpp at gmail dot com Target Milestone: --- Unlike the comment at the end of the original report claims, the bug seems = to be still present (or at least a different shade of it). StackOverflow question: https://stackoverflow.com/questions/70092776/validity-of-presenting-an-xval= ue-as-an-lvalue Repro: https://godbolt.org/z/h943G933a +++ This bug was initially created as a clone of Bug #78209 +++ This came up on the isocpp mailing list yesterday: markus@x4 /tmp % cat test.ii int main() { int &&i =3D 0; decltype(auto) j =3D i; return j; } markus@x4 /tmp % clang++ test.ii test.ii:3:18: error: rvalue reference to type 'int' cannot bind to lvalue of type 'int' decltype(auto) j =3D i; ^ ~ 1 error generated. markus@x4 /tmp % icpc test.ii test.ii(3): error: an rvalue reference cannot be bound to an lvalue decltype(auto) j =3D i; ^ compilation aborted for test.ii (code 2) markus@x4 /tmp % g++ -Wall -Wextra test.ii markus@x4 /tmp %=