-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
[libc++] Fix failure with GCC 15 (#117319) #117322
base: main
Are you sure you want to change the base?
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-libcxx Author: None (killcerr) ChangesFull diff: https://github.com/llvm/llvm-project/pull/117322.diff 1 Files Affected:
diff --git a/libcxx/include/__type_traits/decay.h b/libcxx/include/__type_traits/decay.h
index 7412044f931796..861dc2eb10d061 100644
--- a/libcxx/include/__type_traits/decay.h
+++ b/libcxx/include/__type_traits/decay.h
@@ -25,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __has_builtin(__decay)
+#if __has_builtin(__decay) && !defined(_LIBCPP_COMPILER_GCC)
template <class _Tp>
using __decay_t _LIBCPP_NODEBUG = __decay(_Tp);
|
This comment was marked as resolved.
This comment was marked as resolved.
I already change it.Thanks your comment. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support trunk GCC and this is definitely not the only problem. I don't think it makes sense to add an opt-out in a single place when we know that things are still broken.
Thanks, should i close this pull request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@killcerr Is that the only issue you encountered?
@@ -25,7 +25,7 @@ | |||
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD | |||
|
|||
#if __has_builtin(__decay) | |||
#if __has_builtin(__decay) && !defined(_LIBCPP_COMPILER_GCC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is the GCC-provided builtin incompatible with Clang's?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCC doesn't mangle the builtin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so do we need to do something like
template <class _Tp>
struct __decay_impl {
using type = __builtin_decay_t(_Tp);
};
template <class _Tp>
using __decay_t = typename __decay_impl<_Tp>::type;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use the same way in similar issue
to fix this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, something like that. I'd probably just use decay
as the base (i.e. using __decay_t = decay<T>::type
) for GCC.
Yes, I met it when I complie GCC 15. |
Fixes #117319