public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "okannen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/94679] New: link time error: undefined reference to std::projected<...>::operator *() const
Date: Tue, 21 Apr 2020 07:13:56 +0000	[thread overview]
Message-ID: <bug-94679-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2020-04-21  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21  7:13 okannen at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94679-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).