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 摘要。