public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105584] New: libcxx needs using_if_exist attribute
@ 2022-05-12 16:49 unlvsur at live dot com
  2022-05-12 16:53 ` [Bug c++/105584] " unlvsur at live dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: unlvsur at live dot com @ 2022-05-12 16:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105584
           Summary: libcxx needs using_if_exist attribute
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

https://github.com/llvm/llvm-project/blob/14e83ada16b3944a4431617ed4ce7088f7f7cd9a/libcxx/include/__config#L772

#if __has_attribute(using_if_exists)
# define _LIBCPP_USING_IF_EXISTS __attribute__((using_if_exists))
#else
# define _LIBCPP_USING_IF_EXISTS
#endif

libcxx recently switches a lot of C usings with the new using_if_exists
attribute in clang, but GCC does not support it, causing compilation to fail if
these global definitions do not exist.

/home/cqwrteur/toolchains/native/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/v1/cstdlib:139:9:
error: 'aligned_alloc' has not been declared in '::'
  139 | using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
      |         ^~~~~~~~~~~~~
/home/cqwrteur/toolchains/native/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/v1/ctime:75:9:
error: 'timespec_get' has not been declared in '::'
   75 | using ::timespec_get _LIBCPP_USING_IF_EXISTS;
      |         ^~~~~~~~~~~~
I think GCC should add this attribute to support libcxx correctly.

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

end of thread, other threads:[~2022-10-20 14:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 16:49 [Bug c++/105584] New: libcxx needs using_if_exist attribute unlvsur at live dot com
2022-05-12 16:53 ` [Bug c++/105584] " unlvsur at live dot com
2022-05-12 16:57 ` unlvsur at live dot com
2022-05-12 18:27 ` redi at gcc dot gnu.org
2022-10-20 14:08 ` vital.had at gmail dot com

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).