public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110580] New: [14 Regression] gcc fails to typecheck nix-2.16.1 source: error: invalid initialization of reference of type
@ 2023-07-06 21:46 slyfox at gcc dot gnu.org
  2023-07-07  6:53 ` [Bug c++/110580] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: slyfox at gcc dot gnu.org @ 2023-07-06 21:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110580

            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=55495&action=edit
nar-accessor.cc.cc.xz

Originally observed the build failure on nix-2.16.1 source when building with
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=c++2a
# ok

$ g++-14 -c nar-accessor.cc.cc -std=c++2a
nar-accessor.cc.cc: In instantiation of 'std::pair<typename std::_Rb_tree<_Key,
std::pair<const _Key, _Val>, std::_Select1st<std::pair<const _Key, _Val> >,
_Compare, typename
__gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val>
>::other>::iterator, bool> std::map<_Key, _Tp, _Compare,
_Alloc>::emplace(_Args&& ...) [with _Args = {std::basic_string_view<char,
std::char_traits<char> >, nix::NarMember}; _Key =
std::__cxx11::basic_string<char>; _Tp = nix::NarMember; _Compare =
std::less<std::__cxx11::basic_string<char> >; _Alloc =
std::allocator<std::pair<const std::__cxx11::basic_string<char>,
nix::NarMember> >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Val>,
std::_Select1st<std::pair<const _Key, _Val> >, _Compare, typename
__gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val>
>::other>::iterator = std::_Rb_tree_iterator<std::pair<const
std::__cxx11::basic_string<char>, nix::NarMember> >; typename
__gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val>
>::other = std::allocator<std::pair<const std::__cxx11::basic_string<char>,
nix::NarMember> >; typename
__gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Val> > =
__gnu_cxx::__alloc_traits<std::allocator<std::pair<const
std::__cxx11::basic_string<char>, nix::NarMember> >, std::pair<const
std::__cxx11::basic_string<char>, nix::NarMember> >::rebind<std::pair<const
std::__cxx11::basic_string<char>, nix::NarMember> >; typename
_Allocator::value_type = std::pair<const std::__cxx11::basic_string<char>,
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<std::__cxx11::basic_string<char>, nix::NarMember>::key_type&'
{aka 'const std::__cxx11::basic_string<char>&'} from expression of type
'std::basic_string_view<char>'
33745 |       const key_type& __k = __a;
      |                       ^~~

$ g++ -v |& unnix
Using built-in specs.
COLLECT_GCC=/<<NIX>>/gcc-14.0.0/bin/g++
COLLECT_LTO_WRAPPER=/<<NIX>>/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)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-07-11 19:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 21:46 [Bug c++/110580] New: [14 Regression] gcc fails to typecheck nix-2.16.1 source: error: invalid initialization of reference of type slyfox at gcc dot gnu.org
2023-07-07  6:53 ` [Bug c++/110580] " rguenth at gcc dot gnu.org
2023-07-09  7:02 ` pinskia at gcc dot gnu.org
2023-07-09 15:56 ` pinskia at gcc dot gnu.org
2023-07-09 18:26 ` pinskia at gcc dot gnu.org
2023-07-09 18:37 ` pinskia at gcc dot gnu.org
2023-07-10  5:47 ` pinskia at gcc dot gnu.org
2023-07-10  5:53 ` pinskia at gcc dot gnu.org
2023-07-10 18:24 ` ppalka at gcc dot gnu.org
2023-07-11 14:06 ` cvs-commit at gcc dot gnu.org
2023-07-11 14:06 ` ppalka at gcc dot gnu.org
2023-07-11 19:02 ` slyfox at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).