llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
25.95k stars 10.59k forks source link

Clang frontend command failed with exit code 139 or SIGSEGV (in another variant) #90454

Closed vova7878 closed 2 weeks ago

vova7878 commented 2 weeks ago

Code causing the crash: https://godbolt.org/z/GYnh4En78

Under #if there are two variants of code that cause different error messages

Clang can't handle code like this: template <...> using ... = struct __attribute__((packed)) alignas(...) {...}; Without a template compiler just says the code is incorrect

vova7878 commented 2 weeks ago

I did some testing, the bug has been present since Clang 6.0.0

llvmbot commented 2 weeks ago

@llvm/issue-subscribers-clang-frontend

Author: Vladimir Kozelkov (vova7878)

Code causing the crash: https://godbolt.org/z/GYnh4En78 Under #if there are two variants of code that cause different error messages Clang can't handle code like this: `template <...> using ... = struct __attribute__((packed)) alignas(...) {...};` Without a tamplate compiler just says the code is incorrect
shafik commented 2 weeks ago

Looks like no crash on trunk: https://godbolt.org/z/3TYqEYsqT

Also looks like other implementations reject this code.

vova7878 commented 2 weeks ago

Also looks like other implementations reject this code.

The code is completely incorrect, but should not cause a crash

shafik commented 2 weeks ago

Also looks like other implementations reject this code.

The code is completely incorrect, but should not cause a crash

Just wanted to confirm that was expected. So I will close this since it is fixed in trunk.