compnerd created this revision.
compnerd added a reviewer: aaron.ballman.
Herald added a project: All.
compnerd requested review of this revision.
Herald added a project: clang.

When building with the 17.5.0 preview toolset for MSVC and building with 
modules, the definition of `_addcarry_u64` and `_subborrow_u64` seem to cause 
issues due to the `static` definition following the non-static declaration in 
the MSVC headers.  Elide the `static` storage class on the declaration in MSVC 
mode.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139749

Files:
  clang/lib/Headers/adxintrin.h


Index: clang/lib/Headers/adxintrin.h
===================================================================
--- clang/lib/Headers/adxintrin.h
+++ clang/lib/Headers/adxintrin.h
@@ -43,7 +43,10 @@
 }
 
 #ifdef __x86_64__
-static __inline unsigned char __DEFAULT_FN_ATTRS
+#if !defined(_MSC_VER)
+static
+#endif
+__inline unsigned char __DEFAULT_FN_ATTRS
 _addcarry_u64(unsigned char __cf, unsigned long long __x,
               unsigned long long __y, unsigned long long  *__p)
 {
@@ -59,7 +62,10 @@
 }
 
 #ifdef __x86_64__
-static __inline unsigned char __DEFAULT_FN_ATTRS
+#if !defined(_MSC_VER)
+static
+#endif
+__inline unsigned char __DEFAULT_FN_ATTRS
 _subborrow_u64(unsigned char __cf, unsigned long long __x,
                unsigned long long __y, unsigned long long  *__p)
 {


Index: clang/lib/Headers/adxintrin.h
===================================================================
--- clang/lib/Headers/adxintrin.h
+++ clang/lib/Headers/adxintrin.h
@@ -43,7 +43,10 @@
 }
 
 #ifdef __x86_64__
-static __inline unsigned char __DEFAULT_FN_ATTRS
+#if !defined(_MSC_VER)
+static
+#endif
+__inline unsigned char __DEFAULT_FN_ATTRS
 _addcarry_u64(unsigned char __cf, unsigned long long __x,
               unsigned long long __y, unsigned long long  *__p)
 {
@@ -59,7 +62,10 @@
 }
 
 #ifdef __x86_64__
-static __inline unsigned char __DEFAULT_FN_ATTRS
+#if !defined(_MSC_VER)
+static
+#endif
+__inline unsigned char __DEFAULT_FN_ATTRS
 _subborrow_u64(unsigned char __cf, unsigned long long __x,
                unsigned long long __y, unsigned long long  *__p)
 {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to