Skip to content
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 preferred_type attribute detection #95599

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

SchrodingerZhu
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jun 14, 2024

@llvm/pr-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/95599.diff

1 Files Affected:

  • (modified) libc/src/__support/macros/attributes.h (+1-1)
diff --git a/libc/src/__support/macros/attributes.h b/libc/src/__support/macros/attributes.h
index 7e8e2ddfac9b1..7c8e054436919 100644
--- a/libc/src/__support/macros/attributes.h
+++ b/libc/src/__support/macros/attributes.h
@@ -42,7 +42,7 @@
 #define LIBC_CONSTINIT
 #endif
 
-#ifdef __clang__
+#if __has_attribute(preferred_type)
 #define LIBC_PREFERED_TYPE(TYPE) [[clang::preferred_type(TYPE)]]
 #else
 #define LIBC_PREFERED_TYPE(TYPE)

@SchrodingerZhu SchrodingerZhu merged commit 2146d12 into llvm:main Jun 14, 2024
4 of 5 checks passed
@SchrodingerZhu SchrodingerZhu deleted the libc/attrfix branch June 14, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants