public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/105128] New: source_location compile error for clang
@ 2022-04-01 15:32 unlvsur at live dot com
  2022-04-01 15:39 ` [Bug libstdc++/105128] source_location compile error for latest clang 15 unlvsur at live dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: unlvsur at live dot com @ 2022-04-01 15:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105128
           Summary: source_location compile error for clang
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

It looks like clang just added source_location implementation but the built-in
looks different. Unfortunately, libcxx does not implement this either at this
point. However, the testsuite probably tells how clang implements this.

https://github.com/llvm/llvm-project/blob/d61487490022aaacc34249475fac3e208c7d767e/clang/test/CodeGenCXX/builtin-source-location.cpp

#include<source_location>

int main()
{
        std::source_location::current();
}

clang++ -o sourcelocation sourcelocation.cc -Ofast -std=c++2b -s -flto=thin
-fuse-ld=lld
In file included from sourcelocation.cc:1:
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/source_location:46:41:
error: 'std::source_location::__impl' was not found; it must be defined before
'__builtin_source_location' is called
    using __builtin_ret_type = decltype(__builtin_source_location());
                                        ^
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/source_location:52:13:
error: unknown type name '__builtin_ret_type'
    current(__builtin_ret_type __p = __builtin_source_location()) noexcept
            ^
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/source_location:52:32:
error: cannot initialize a parameter of type 'int' with an rvalue of type
'const std::source_location::__impl *'
    current(__builtin_ret_type __p = __builtin_source_location()) noexcept
                               ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/source_location:52:32:
note: passing argument to parameter '__p' here
3 errors generated.

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

end of thread, other threads:[~2022-07-07 23:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-01 15:32 [Bug libstdc++/105128] New: source_location compile error for clang unlvsur at live dot com
2022-04-01 15:39 ` [Bug libstdc++/105128] source_location compile error for latest clang 15 unlvsur at live dot com
2022-04-01 17:50 ` jakub at gcc dot gnu.org
2022-04-01 18:07 ` unlvsur at live dot com
2022-04-02 10:50 ` cvs-commit at gcc dot gnu.org
2022-04-02 10:51 ` jakub at gcc dot gnu.org
2022-07-07 23:32 ` cvs-commit at gcc dot gnu.org
2022-07-07 23:33 ` redi 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).