Skip to content

Commit aa4e9cb

Browse files
committed
Basic: set the correct storage class for the alignment
`cl` objects to the initialization of the templated type differing in storage class due to the indication of `constexpr`. `constexpr` does not give the value itself a `const` storage class. However, because the value is not initialized inline, it does not like the `constexpr` attribute. Apply the `constexpr` only on clang, and correct the storage to `const`.
1 parent 542d02a commit aa4e9cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/swift/Basic/ImmutablePointerSet.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,10 @@ ImmutablePointerSet<T> ImmutablePointerSetFactory<T>::EmptyPtrSet =
349349
ImmutablePointerSet<T>(nullptr, {});
350350

351351
template <typename T>
352-
constexpr unsigned ImmutablePointerSetFactory<T>::AllocAlignment =
352+
#if !defined(_MSC_VER) || defined(__clang__)
353+
constexpr
354+
#endif
355+
const unsigned ImmutablePointerSetFactory<T>::AllocAlignment =
353356
(alignof(PtrSet) > alignof(PtrTy)) ? alignof(PtrSet) : alignof(PtrTy);
354357

355358
} // end swift namespace

0 commit comments

Comments
 (0)