llvm / llvm/llvm-project

[clang]i686-windows-gnu and i686-linux-musl static assertion failed. I guess it is a 32 bit host specific issue

Open
#223,631 6 comments 0 reactions 0 assignees View on GitHub
clang:frontend crash
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

```
/home/esoeel/toolchains_build/llvm-project/clang/include/clang/AST/TypeBase.h:2416:19: error: static assertion failed due to requirement 'sizeof (*this) <= alignof(clang::Type &) + sizeof(clang::ExtQualsTypeCommonBase)': changing bitfields changed sizeof(Type)!
2416 | static_assert(sizeof(*this) <=
| ^~~~~~~~~~~~~~~~
2417 | alignof(decltype(*this)) + sizeof(ExtQualsTypeCommonBase),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/shengdun/toolchains_build/llvm-project/clang/include/clang/AST/TypeBase.h:2416:33: note: expression evaluates to '32 <= 24'
2416 | static_assert(sizeof(*this) <=
| ~~~~~~~~~~~~~~^~
2417 | alignof(decltype(*this)) + sizeof(ExtQualsTypeCommonBase),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
@MaskRay

Contributor guide

Open the contributing guide

Research direction

Start at clang/include/clang/AST/TypeBase.h:2416 and inspect the surrounding Type and ExtQualsTypeCommonBase layout, focusing on why the i686 targets produce 32 <= 24. Reproduce the assertion on the reported i686-windows-gnu and i686-linux-musl hosts; done means the affected targets build without this static assertion failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.