vasild wrote:

https://github.com/bitcoin/bitcoin/ fails to compile with clang 22 due to:

<details>
<summary>clang crash output</summary>

```
Assertion failed: (!CodeSynthesisContexts.empty()), function getCurLambda, file 
/usr/ports/devel/llvm-devel/work-default/llvm-project-1546138e6f18f2e7d0ca90eebe0ffc18c2364bf6/clang/lib/Sema/Sema.cpp,
 line 2574.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and 
include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /usr/local/llvm-devel/bin/clang++ -O0 -ftrapv -g3 
-std=c++20 -fPIC -fcolor-diagnostics 
-fdebug-prefix-map=BUILD/bitcoin/bitcoin/src=. 
-fmacro-prefix-map=BUILD/bitcoin/bitcoin/src=. -Wstack-protector 
-fstack-protector-all -fcf-protection=full -fstack-clash-protection -pthread 
-Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field 
-Wthread-safety -Wthread-safety-pointer -Wloop-analysis -Wredundant-decls 
-Wunused-member-function -Wdate-time -Wconditional-uninitialized 
-Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough 
-Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter 
-Wno-error=sign-compare -Werror -DABORT_ON_FAILED_ASSUME 
-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDEBUG -DDEBUG_LOCKCONTENTION 
-DDEBUG_LOCKORDER -DRPC_DOC_CHECK -I/tmp/build/clang22/src 
-IBUILD/bitcoin/bitcoin/src -IBUILD/bitcoin/bitcoin/src/univalue/include 
-isystem /usr/local/include -c -o 
src/wallet/CMakeFiles/bitcoin_wallet.dir/rpc/spend.cpp.o 
BUILD/bitcoin/bitcoin/src/wallet/rpc/spend.cpp
1.      BUILD/bitcoin/bitcoin/src/wallet/rpc/spend.cpp:473:2: current parser 
token ','
2.      BUILD/bitcoin/bitcoin/src/wallet/rpc/spend.cpp:34:1: parsing namespace 
'wallet'
3.      BUILD/bitcoin/bitcoin/src/wallet/rpc/spend.cpp:431:1: parsing function 
body 'wallet::settxfee'
4.      BUILD/bitcoin/bitcoin/src/wallet/rpc/spend.cpp:431:1: in compound 
statement ('{}')
5.      BUILD/bitcoin/bitcoin/src/wallet/rpc/spend.cpp:446:9: lambda expression 
parsing
 #0 0x000000082de45e96 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) 
(/usr/local/llvm-devel/lib/libLLVM.so.22.0git+0x5245e96)
 #1 0x000000082de43703 llvm::sys::RunSignalHandlers() 
(/usr/local/llvm-devel/lib/libLLVM.so.22.0git+0x5243703)
 #2 0x000000082dd61b82 (/usr/local/llvm-devel/lib/libLLVM.so.22.0git+0x5161b82)
 #3 0x0000000821b6a2fc handle_signal /usr/src/lib/libthr/thread/thr_sig.c:0:3
 #4 0x0000000821b6990b thr_sighandler /usr/src/lib/libthr/thread/thr_sig.c:262:1
 #5 0x00000008211192d3 ([vdso]+0x2d3)
 #6 0x0000000833799a1a thr_kill /usr/obj/amd64.amd64/lib/libsys/thr_kill.S:4:0
 #7 0x000000082807a834 _raise /usr/src/lib/libc/gen/raise.c:0:10
 #8 0x000000082812c579 abort /usr/src/lib/libc/stdlib/abort.c:67:17
 #9 0x000000082805d421 (/lib/libc.so.7+0xa1421)
#10 0x0000000824fb0883 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x23b0883)
#11 0x00000008253838dd clang::Sema::ActOnFinishFullExpr(clang::Expr*, 
clang::SourceLocation, bool, bool, bool) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x27838dd)
#12 0x000000082558ac4c 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x298ac4c)
#13 0x000000082558a65d 
clang::Sema::BuildConvertedConstantExpression(clang::Expr*, clang::QualType, 
clang::CCEKind, clang::NamedDecl*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x298a65d)
#14 0x00000008256537a4 clang::Sema::CheckTemplateArgument(clang::NamedDecl*, 
clang::QualType, clang::Expr*, clang::TemplateArgument&, 
clang::TemplateArgument&, bool, clang::Sema::CheckTemplateArgumentKind) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x2a537a4)
#15 0x0000000825652239 clang::Sema::CheckTemplateArgument(clang::NamedDecl*, 
clang::TemplateArgumentLoc&, clang::NamedDecl*, clang::SourceLocation, 
clang::SourceLocation, unsigned int, clang::Sema::CheckTemplateArgumentInfo&, 
clang::Sema::CheckTemplateArgumentKind) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x2a52239)
#16 0x0000000825656141 
clang::Sema::CheckTemplateArgumentList(clang::TemplateDecl*, 
clang::TemplateParameterList*, clang::SourceLocation, 
clang::TemplateArgumentListInfo&, clang::DefaultArguments const&, bool, 
clang::Sema::CheckTemplateArgumentInfo&, bool, bool*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x2a56141)
#17 0x000000082564640e 
clang::Sema::CheckTemplateIdType(clang::ElaboratedTypeKeyword, 
clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&, 
clang::Scope*, bool) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x2a4640e)
#18 0x00000008252d6f61 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x26d6f61)
#19 0x00000008252cc0a1 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x26cc0a1)
#20 0x00000008252cbdd1 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x26cbdd1)
#21 0x00000008252c9b75 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x26c9b75)
#22 0x00000008252a7cce clang::Sema::PopExpressionEvaluationContext() 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x26a7cce)
#23 0x000000082540a229 clang::Sema::BuildLambdaExpr(clang::SourceLocation, 
clang::SourceLocation) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x280a229)
#24 0x00000008243c9af6 
clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17c9af6)
#25 0x00000008243c6c1b clang::Parser::ParseLambdaExpression() 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17c6c1b)
#26 0x00000008243b6eba clang::Parser::ParseCastExpression(clang::CastParseKind, 
bool, bool&, clang::TypoCorrectionTypeBehavior, bool, bool*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17b6eba)
#27 0x00000008243b1622 
clang::Parser::ParseAssignmentExpression(clang::TypoCorrectionTypeBehavior) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17b1622)
#28 0x00000008243e0b28 clang::Parser::ParseBraceInitializer() 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17e0b28)
#29 0x00000008243cc1cf 
clang::Parser::ParseCXXTypeConstructExpression(clang::DeclSpec const&) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17cc1cf)
#30 0x00000008243b63a9 clang::Parser::ParseCastExpression(clang::CastParseKind, 
bool, bool&, clang::TypoCorrectionTypeBehavior, bool, bool*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17b63a9)
#31 0x00000008243b5f8b clang::Parser::ParseCastExpression(clang::CastParseKind, 
bool, bool&, clang::TypoCorrectionTypeBehavior, bool, bool*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17b5f8b)
#32 0x00000008243b1622 
clang::Parser::ParseAssignmentExpression(clang::TypoCorrectionTypeBehavior) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17b1622)
#33 0x00000008243b14de 
clang::Parser::ParseExpression(clang::TypoCorrectionTypeBehavior) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17b14de)
#34 0x000000082442d563 clang::Parser::ParseReturnStatement() 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x182d563)
#35 0x0000000824426bed 
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, 
clang::ParsedAttributes&, clang::ParsedAttributes&, clang::LabelDecl*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x1826bed)
#36 0x00000008244256a1 
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 
24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, 
clang::LabelDecl*) (/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x18256a1)
#37 0x000000082442fbf7 clang::Parser::ParseCompoundStatementBody(bool) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x182fbf7)
#38 0x0000000824430aa5 clang::Parser::ParseFunctionStatementBody(clang::Decl*, 
clang::Parser::ParseScope&) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x1830aa5)
#39 0x000000082444ae5e 
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, 
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x184ae5e)
#40 0x000000082437a985 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, 
clang::DeclaratorContext, clang::ParsedAttributes&, 
clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, 
clang::Parser::ForRangeInit*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x177a985)
#41 0x0000000824449f1f 
clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, 
clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x1849f1f)
#42 0x00000008244497be 
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, 
clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x18497be)
#43 0x0000000824448713 
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, 
clang::ParsedAttributes&, clang::ParsingDeclSpec*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x1848713)
#44 0x0000000824398a5b 
clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo,
 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, 
clang::BalancedDelimiterTracker&) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x1798a5b)
#45 0x0000000824398155 clang::Parser::ParseNamespace(clang::DeclaratorContext, 
clang::SourceLocation&, clang::SourceLocation) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x1798155)
#46 0x00000008243781e8 
clang::Parser::ParseDeclaration(clang::DeclaratorContext, 
clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, 
clang::SourceLocation*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x17781e8)
#47 0x00000008244482c3 
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, 
clang::ParsedAttributes&, clang::ParsingDeclSpec*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x18482c3)
#48 0x0000000824446e85 
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, 
clang::Sema::ModuleImportState&) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x1846e85)
#49 0x000000082436499e clang::ParseAST(clang::Sema&, bool, bool) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x176499e)
#50 0x00000008264c7fb8 clang::FrontendAction::Execute() 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x38c7fb8)
#51 0x000000082644455d 
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x384455d)
#52 0x000000082656b46c 
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x396b46c)
#53 0x00000000002149ca cc1_main(llvm::ArrayRef<char const*>, char const*, 
void*) (/usr/local/llvm-devel/bin/clang+++0x2149ca)
#54 0x00000000002116b5 (/usr/local/llvm-devel/bin/clang+++0x2116b5)
#55 0x00000000002137df (/usr/local/llvm-devel/bin/clang+++0x2137df)
#56 0x000000082609730e 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x349730e)
#57 0x000000082dd617dc 
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) 
(/usr/local/llvm-devel/lib/libLLVM.so.22.0git+0x51617dc)
#58 0x000000082609695a 
clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>,
 std::__1::basic_string<char, std::__1::char_traits<char>, 
std::__1::allocator<char>>*, bool*) const 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x349695a)
#59 0x0000000826055094 
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, 
clang::driver::Command const*&, bool) const 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x3455094)
#60 0x000000082605531c 
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, 
llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&, 
bool) const (/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x345531c)
#61 0x0000000826075ca6 
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, 
llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) 
(/usr/local/llvm-devel/lib/libclang-cpp.so.22.0git+0x3475ca6)
#62 0x0000000000210b40 clang_main(int, char**, llvm::ToolContext const&) 
(/usr/local/llvm-devel/bin/clang+++0x210b40)
#63 0x000000000021f472 main (/usr/local/llvm-devel/bin/clang+++0x21f472)
#64 0x000000082804f26f __libc_start1 /usr/src/lib/libc/csu/libc_start1.c:180:2
clang++: error: clang frontend command failed with exit code 134 (use -v to see 
invocation)
clang version 22.0.0git
Target: x86_64-portbld-freebsd15.0
Thread model: posix
InstalledDir: /usr/local/llvm-devel/bin
Build config: +assertions
clang++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/spend-268242.cpp
clang++: note: diagnostic msg: /tmp/spend-268242.sh
clang++: note: diagnostic msg: 

********************
```
</details>

This PR fixes it. Thanks!

https://github.com/llvm/llvm-project/pull/176319
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to