https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105584
--- Comment #5 from Sergey Fedorov <vital.had at gmail dot com> --- (In reply to cqwrteur from comment #0) > 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. I am getting similar errors with `libstdc++` now and gcc14 (on x86_64): ``` /opt/local/bin/g++-mp-14 -DU_ALL_IMPLEMENTATION -DU_ATTRIBUTE_DEPRECATED= -DU_COMMON_IMPLEMENTATION -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -I. "-DDEFAULT_ICU_PLUGINS=\"/opt/local/lib/icu\" " -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -std=c++17 -fvisibility=hidden -fno-common -c -MMD -MT "putil.d putil.o putil.ao" -o putil.ao putil.cpp In file included from /opt/local/include/gcc14/c++/stdlib.h:36, from uassert.h:23, from putil.cpp:62: /opt/local/include/gcc14/c++/cstdlib:136:11: error: 'aligned_alloc' has not been declared in '::' 136 | using ::aligned_alloc; | ^~~~~~~~~~~~~ /opt/local/bin/g++-mp-14 -DU_ALL_IMPLEMENTATION -DU_ATTRIBUTE_DEPRECATED= -DU_COMMON_IMPLEMENTATION -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -I. "-DDEFAULT_ICU_PLUGINS=\"/opt/local/lib/icu\" " -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -std=c++17 -fvisibility=hidden -fno-common -c -MMD -MT "rbbi.d rbbi.o rbbi.ao" -o rbbi.ao rbbi.cpp In file included from /opt/local/include/gcc14/c++/bits/chrono.h:40, from /opt/local/include/gcc14/c++/condition_variable:40, from umutex.h:24, from putil.cpp:63: /opt/local/include/gcc14/c++/ctime:80:11: error: 'timespec_get' has not been declared in '::' 80 | using ::timespec_get; | ^~~~~~~~~~~~ ```