From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C69093857C66; Thu, 6 Jul 2023 21:46:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C69093857C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688680010; bh=D750QM41tawVT/BcIP8yeYZKE8l2K76rbNDBZQvq3RI=; h=From:To:Subject:Date:From; b=q/ydcPeRXb9fx4kGQJuYsxQPVYztPI8bmuFVy8AxhyfTNkknC4nSW83TmFYygkQAy 80tDwfgGygQRXlwdJGBhXlyou2wIjDOnhyBF7GgeUFTqZDVj+6k/yU++6Ehp+Juj8U 0CM1ATincT9Z4zt3kML9aaBX524oJcK/GRHmdOG4= From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110580] New: [14 Regression] gcc fails to typecheck nix-2.16.1 source: error: invalid initialization of reference of type Date: Thu, 06 Jul 2023 21:46:50 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org 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 attachments.created 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=3D110580 Bug ID: 110580 Summary: [14 Regression] gcc fails to typecheck nix-2.16.1 source: error: invalid initialization of reference of type Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- Created attachment 55495 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55495&action=3Dedit nar-accessor.cc.cc.xz Originally observed the build failure on nix-2.16.1 source when building wi= th gcc r14-2344-g9f4f833455bb35. I suspect it might be a form of https://gcc.gnu.org/PR110523 regression. But filing just in case. Attached unmodified preprocessed example. The build succeeds on gcc-13: $ g++-13 -c nar-accessor.cc.cc -std=3Dc++2a # ok $ g++-14 -c nar-accessor.cc.cc -std=3Dc++2a nar-accessor.cc.cc: In instantiation of 'std::pair, std::_Select1st >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::emplace(_Args&& ...) [with _Args =3D {std::basic_string_view >, nix::NarMember}; _Key =3D std::__cxx11::basic_string; _Tp =3D nix::NarMember; _Compare =3D std::less >; _Alloc =3D std::allocator, nix::NarMember> >; typename std::_Rb_tree<_Key, std::pair, std::_Select1st >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind >::other>::iterator =3D std::_Rb_tree_iterator, nix::NarMember> >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind >::other =3D std::allocator, nix::NarMember> >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind >= =3D __gnu_cxx::__alloc_traits, nix::NarMember> >, std::pair, nix::NarMember> >::rebind, nix::NarMember> >; typename _Allocator::value_type =3D std::pair, nix::NarMember>]': nar-accessor.cc.cc:126951:62: required from here nar-accessor.cc.cc:33745:23: error: invalid initialization of reference of = type 'const std::map, nix::NarMember>::key_type= &' {aka 'const std::__cxx11::basic_string&'} from expression of type 'std::basic_string_view' 33745 | const key_type& __k =3D __a; | ^~~ $ g++ -v |& unnix Using built-in specs. COLLECT_GCC=3D/<>/gcc-14.0.0/bin/g++ COLLECT_LTO_WRAPPER=3D/<>/gcc-14.0.0/libexec/gcc/x86_64-unknown-linux-= gnu/14.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 99999999 (experimental) (GCC)=