public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/94679] New: link time error: undefined reference to std::projected<...>::operator *() const
@ 2020-04-21  7:13 okannen at gmail dot com
  2020-04-21  8:26 ` [Bug c++/94679] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: okannen at gmail dot com @ 2020-04-21  7:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94679
           Summary: link time error: undefined reference to
                    std::projected<...>::operator *() const
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: okannen at gmail dot com
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64
             Build: x86_64-pc-linux-gnu

When compiling with -coverage -fkeep-inline-functions, it is possible to get a
linkage error: 'undefined reference to
`std::projected<int*,std::identity>::operator*() const'


gcc --version:
gcc (GCC) 10.0.1 20200416 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc -v:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/olivier/usr/libexec/gcc/x86_64-pc-linux-gnu/10/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --enable-libsanitizer
--prefix=/home/olivier/usr/ --with-gcc-major-version-only --disable-bootstrap
--enable-language=c,c++,lto
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.0.1 20200416 (experimental) (GCC)


The following code compiled with:
'c++ -coverage -fkeep-inline-functions -std=c++20 file.cpp'

#include <algorithm>
int main(){
  int a[]={1,2,3};
  std::ranges::next_permutation(a);
  return 0;
  }

This produce error message:
/usr/bin/ld: /tmp/ccF8BXBM.o: in function `decltype(auto)
std::ranges::__cust_imove::_IMove::operator()<std::projected<int*,
std::identity>&>(std::projected<int*, std::identity>&) const':
test.cpp:(.text._ZNKSt6ranges12__cust_imove6_IMoveclIRSt9projectedIPiSt8identityEEEDcOT_[_ZNKSt6ranges12__cust_imove6_IMoveclIRSt9projectedIPiSt8identityEEEDcOT_]+0x2a):
undefined reference to `std::projected<int*, std::identity>::operator*() const'
/usr/bin/ld: /tmp/ccF8BXBM.o: in function `decltype(auto)
std::ranges::__cust_imove::_IMove::operator()<std::projected<int*,
std::identity> const&>(std::projected<int*, std::identity> const&) const':
test.cpp:(.text._ZNKSt6ranges12__cust_imove6_IMoveclIRKSt9projectedIPiSt8identityEEEDcOT_[_ZNKSt6ranges12__cust_imove6_IMoveclIRKSt9projectedIPiSt8identityEEEDcOT_]+0x2a):
undefined reference to `std::projected<int*, std::identity>::operator*() const'
collect2: error: ld returned 1 exit status

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

end of thread, other threads:[~2021-08-13 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21  7:13 [Bug libstdc++/94679] New: link time error: undefined reference to std::projected<...>::operator *() const okannen at gmail dot com
2020-04-21  8:26 ` [Bug c++/94679] " redi at gcc dot gnu.org
2020-04-21  8:41 ` redi at gcc dot gnu.org
2021-08-13 19:09 ` pinskia 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).