abseil / abseil/abseil-cpp

[Bug]: absl/strings/internal/cord_rep_flat.h(42,39): error C2131: expression did not evaluate to a constant

未關閉
#1,554 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C++
星號
18.1k
分支
3.2k
平均合併
20 小時 36 分鐘
30 天內合併 PR
1

描述

### Describe the issue

`cord_rep_flat.h` does not compile with MSVC on Windows due to the `offsetof` macro definition in `stddef.h`:

```
// C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stddef.h
#if defined _MSC_VER && !defined _CRT_USE_BUILTIN_OFFSETOF
#ifdef __cplusplus
// This one is used in my setup
#define offsetof(s,m) ((::size_t)&reinterpret_cast((((s*)0)->m)))
#else
#define offsetof(s,m) ((size_t)&(((s*)0)->m))
#endif
#else
#define offsetof(s,m) __builtin_offsetof(s,m)
#endif
```

### Steps to reproduce the problem

```cpp
// Anything that transitively includes
#include
```

### What version of Abseil are you using?

`20230125.3` from conancenter

### What operating system and version are you using?

Windows 11

### What compiler and version are you using?

I *think* I'm using Microsoft (R) C/C++ Optimizing Compiler Version 19.37.32824 for x64 but MSBuild is inscrutable.

### What build system are you using?

CMake 3.27.6

### Additional context

_No response_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。