Skip to content

Commit 8821bca

Browse files
committed
Actually check the last case, add an #error if the size is unhandled
Also check for _MSC_VER for MSVC, as this file is copied and included in the main LLVM build as well.
1 parent e588b29 commit 8821bca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libcxxabi/src/demangle/ItaniumDemangle.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5743,10 +5743,14 @@ struct FloatData<long double>
57435743
{
57445744
#if __LDBL_MANT_DIG__ == 113
57455745
static const size_t mangled_size = 32;
5746-
#elif __LDBL_MANT_DIG__ == 53
5746+
#elif __LDBL_MANT_DIG__ == 53 || defined(_MSC_VER)
5747+
// MSVC doesn't define __LDBL_MANT_DIG__, but it has long double equal to
5748+
// regular double on all current architectures.
57475749
static const size_t mangled_size = 16;
5748-
#else // __LDBL_MANT_DIG__ == 64
5750+
#elif __LDBL_MANT_DIG__ == 64
57495751
static const size_t mangled_size = 20;
5752+
#else
5753+
#error Unknown size for __LDBL_MANT_DIG__
57505754
#endif
57515755
// `-0x1.ffffffffffffffffffffffffffffp+16383` + 'L' + '\0' == 42 bytes.
57525756
// 28 'f's * 4 bits == 112 bits, which is the number of mantissa bits.

0 commit comments

Comments
 (0)