New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__bases and __direct_bases intrinsics are not supported (N2965) #24289
Comments
I'm considering using If necessary I could check |
Is this really still a known problem with recent releases of llvm/clang? |
Well, we still don't support those intrinsics, as far as I can tell. I'm not sure something will change today if no action was taken back then. |
No. I don't even remember what I was thinking of using it for. It's just an obscure, unused extension in a non-standard header. |
I've just pushed this to fix the problem including that header with Clang: |
These non-standard extensions use GCC-specific built-ins. Use __has_builtin to avoid errors when Clang compiles this header. See llvm/llvm-project#24289 libstdc++-v3/ChangeLog: * include/tr2/type_traits (bases, direct_bases): Use __has_builtin to check if required built-ins are supported.
Tested x86_64-linux. Pusued to trunk. I'll backport it too. -- >8 -- These non-standard extensions use GCC-specific built-ins. Use __has_builtin to avoid errors when Clang compiles this header. See llvm/llvm-project#24289 libstdc++-v3/ChangeLog: * include/tr2/type_traits (bases, direct_bases): Use __has_builtin to check if required built-ins are supported.
Thank you for the timely response! |
@llvm/issue-subscribers-c-1 Author: None (llvmbot)
| | |
| --- | --- |
| Bugzilla Link | [23915](https://llvm.org/bz23915) |
| Version | trunk |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @tstellar,@jwakely |
Extended DescriptionClang cannot compile GCC header $ clang --version
clang version 3.7.0 (trunk)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ cat test.cpp #include <tr2/type_traits> $ clang -std=c++11 -c test.cpp
In file included from test.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/tr2/type_traits:90:45: error: '_Tp' does not refer to a value
typedef __reflection_typelist<__bases(_Tp)...> type;
^
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/tr2/type_traits:87:21: note: declared here
template<typename _Tp>
^
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/tr2/type_traits:97:52: error: '_Tp' does not refer to a value
typedef __reflection_typelist<__direct_bases(_Tp)...> type;
^
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/tr2/type_traits:94:21: note: declared here
template<typename _Tp>
^
2 errors generated. As you can see, Clang does not support Alexey FrolovSoftware Engineer |
Funky! I didn't even really understand the problem and got curious because we were facing a related one. Thanks for all the lovely momentum in here, this is a great example for splendid open-source collaboration. |
These non-standard extensions use GCC-specific built-ins. Use __has_builtin to avoid errors when Clang compiles this header. See llvm/llvm-project#24289 libstdc++-v3/ChangeLog: * include/tr2/type_traits (bases, direct_bases): Use __has_builtin to check if required built-ins are supported. (cherry picked from commit 5fb204a)
These non-standard extensions use GCC-specific built-ins. Use __has_builtin to avoid errors when Clang compiles this header. See llvm/llvm-project#24289 libstdc++-v3/ChangeLog: * include/tr2/type_traits (bases, direct_bases): Use __has_builtin to check if required built-ins are supported. (cherry picked from commit 5fb204aaf34b68c427f5b2bfb933fed72fe3eafb)
These non-standard extensions use GCC-specific built-ins. Use __has_builtin to avoid errors when Clang compiles this header. See llvm/llvm-project#24289 libstdc++-v3/ChangeLog: * include/tr2/type_traits (bases, direct_bases): Use __has_builtin to check if required built-ins are supported.
These non-standard extensions use GCC-specific built-ins. Use __has_builtin to avoid errors when Clang compiles this header. See llvm/llvm-project#24289 libstdc++-v3/ChangeLog: * include/tr2/type_traits (bases, direct_bases): Use __has_builtin to check if required built-ins are supported.
These non-standard extensions use GCC-specific built-ins. Use __has_builtin to avoid errors when Clang compiles this header. See llvm/llvm-project#24289 libstdc++-v3/ChangeLog: * include/tr2/type_traits (bases, direct_bases): Use __has_builtin to check if required built-ins are supported.
These non-standard extensions use GCC-specific built-ins. Use __has_builtin to avoid errors when Clang compiles this header. See llvm/llvm-project#24289 libstdc++-v3/ChangeLog: * include/tr2/type_traits (bases, direct_bases): Use __has_builtin to check if required built-ins are supported.
These non-standard extensions use GCC-specific built-ins. Use __has_builtin to avoid errors when Clang compiles this header. See llvm/llvm-project#24289 libstdc++-v3/ChangeLog: * include/tr2/type_traits (bases, direct_bases): Use __has_builtin to check if required built-ins are supported.
Extended Description
Clang cannot compile GCC header
tr2/type_traits
(see below).Type traits "bases" and "direct_bases" were proposed as N2965 for C++11 standard, but were not included.
The feature is well-documented (see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2965.html) and is supported by GCC.
There are some questions and requests regarding this feature on developer forums (for example, http://stackoverflow.com/questions/18435001/what-is-the-status-of-n2965-stdbases-and-stddirect-bases).
As you can see, Clang does not support
__bases
and__direct_bases
intrinsics.Alexey Frolov
Software Engineer
Intel Compiler Team
Intel
The text was updated successfully, but these errors were encountered: