llvm / llvm-project

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

Anonymous struct construct causes a Clang front-end assertion. #86855

Open dgilmore83 opened 6 months ago

dgilmore83 commented 6 months ago

A ToT "asserts" build of Clang in the following test case that uses the anonymous struct construct. I attached the test case per the "HowToSubmitABug" instructions: anon-6e7926.cpp.txt anon-6e7926.sh.txt

The assertion message is: clang++: /tmp/dgilmore/tt/clang/lib/CodeGen/CGExprAgg.cpp:1751: void {anonymous}::AggExprEmitter::VisitCXXParenListOrInitListExpr(clang::Expr, llvm::ArrayRef<clang::Expr>, clang::FieldDecl, clang::Expr): Assertion `(Field->isUnnamedBitfield() || Field->isAnonymousStructOrUnion()) && "Only unnamed bitfields or ananymous class allowed"' failed.

llvmbot commented 6 months ago

@llvm/issue-subscribers-clang-codegen

Author: None (dgilmore83)

A ToT "asserts" build of Clang in the following test case that uses the anonymous struct construct. I attached the test case per the "HowToSubmitABug" instructions: [anon-6e7926.cpp.txt](https://github.com/llvm/llvm-project/files/14780063/anon-6e7926.cpp.txt) [anon-6e7926.sh.txt](https://github.com/llvm/llvm-project/files/14780067/anon-6e7926.sh.txt) The assertion message is: clang++: /tmp/dgilmore/tt/clang/lib/CodeGen/CGExprAgg.cpp:1751: void {anonymous}::AggExprEmitter::VisitCXXParenListOrInitListExpr(clang::Expr*, llvm::ArrayRef<clang::Expr*>, clang::FieldDecl*, clang::Expr*): Assertion `(Field->isUnnamedBitfield() || Field->isAnonymousStructOrUnion()) && "Only unnamed bitfields or ananymous class allowed"' failed.