<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62157>62157</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
berolinux
</td>
</tr>
</table>
<pre>
Trying to build boost 1.82.0 with clang 16.0.1 results in
```
"clang++" -c -x c++ -fvisibility-inlines-hidden -fPIC -m64 -pthread -Wall -g -fvisibility=hidden -Wno-inline -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -O3 -m64 -march=znver1 -mtune=znver1 -mmmx -msse -msse2 -mssse3 -msse4a -msse4.1 -msse4.2 -mavx -mavx2 -msha -maes -mclflushopt -mfsgsbase -mrdrnd -mfma -mrdseed -mpopcnt -madx -mbmi -mbmi2 -mfxsr -mxsave -mxsaveopt -mxsavec -mxsaves -mmwaitx -mclzero -mfpmath=sse -O3 -fno-strict-aliasing -I/usr/include/libunwind -fPIC -fno-semantic-interposition -march=znver1 --target=x86_64-pc-linux -DBOOST_ALL_NO_LIB=1 -DBOOST_URL_DYN_LINK=1 -DBOOST_URL_SOURCE -DNDEBUG -I"." -o "bin.v2/libs/url/build/clang-linux-16/release/debug-symbols-on/instruction-set-znver1/pch-off/threading-multi/visibility-hidden/src.o" "libs/url/src/src.cpp"
clang++: /builddir/build/BUILD/llvm-project-16.0.1.src/llvm/include/llvm/Support/Casting.h:579: decltype(auto) llvm::cast(From *) [To = clang::CXXConstructExpr, From = clang::Expr]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
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: clang++ -c -x c++ -fvisibility-inlines-hidden -fPIC -m64 -pthread -Wall -g -fvisibility=hidden -Wno-inline -Os -fomit-frame-pointer -g3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -O3 -m64 -march=znver1 -mtune=znver1 -mmmx -msse -msse2 -mssse3 -msse4a -msse4.1 -msse4.2 -mavx -mavx2 -msha -maes -mclflushopt -mfsgsbase -mrdrnd -mfma -mrdseed -mpopcnt -madx -mbmi -mbmi2 -mfxsr -mxsave -mxsaveopt -mxsavec -mxsaves -mmwaitx -mclzero -mfpmath=sse -O3 -fno-strict-aliasing -I/usr/include/libunwind -fPIC -fno-semantic-interposition -march=znver1 --target=x86_64-pc-linux -DBOOST_ALL_NO_LIB=1 -DBOOST_URL_DYN_LINK=1 -DBOOST_URL_SOURCE -DNDEBUG -I. -o bin.v2/libs/url/build/clang-linux-16/release/debug-symbols-on/instruction-set-znver1/pch-off/threading-multi/visibility-hidden/src.o libs/url/src/src.cpp
1. ./boost/url/impl/segments_view.ipp:33:1: current parser token '{'
2. ./boost/url/impl/segments_view.ipp:17:1: parsing namespace 'boost'
3. ./boost/url/impl/segments_view.ipp:18:1: parsing namespace 'boost::urls'
#0 0x00007f0fc63b0486 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM-16.so+0x47b0486)
#1 0x00007f0fc63aefaa llvm::sys::RunSignalHandlers() (/lib64/libLLVM-16.so+0x47aefaa)
#2 0x00007f0fc62963ad (/lib64/libLLVM-16.so+0x46963ad)
#3 0x00007f0fc1652b30 (/lib64/libc.so.6+0x38b30)
#4 0x00007f0fc16a158c (/lib64/libc.so.6+0x8758c)
#5 0x00007f0fc1652a82 raise (/lib64/libc.so.6+0x38a82)
#6 0x00007f0fc163c4ad abort (/lib64/libc.so.6+0x224ad)
#7 0x00007f0fc163c3d5 (/lib64/libc.so.6+0x223d5)
#8 0x00007f0fc164b6b2 (/lib64/libc.so.6+0x316b2)
#9 0x00007f0fce3fba65 clang::Sema::BuildDelegatingInitializer(clang::TypeSourceInfo*, clang::Expr*, clang::CXXRecordDecl*) (/lib64/libclang-cpp.so.16+0x25fba65)
#10 0x00007f0fce3faf90 clang::Sema::BuildBaseInitializer(clang::QualType, clang::TypeSourceInfo*, clang::Expr*, clang::CXXRecordDecl*, clang::SourceLocation) (/lib64/libclang-cpp.so.16+0x25faf90)
#11 0x00007f0fce3f922f clang::Sema::BuildMemInitializer(clang::Decl*, clang::Scope*, clang::CXXScopeSpec&, clang::IdentifierInfo*, clang::OpaquePtr<clang::QualType>, clang::DeclSpec const&, clang::SourceLocation, clang::Expr*, clang::SourceLocation) (/lib64/libclang-cpp.so.16+0x25f922f)
#12 0x00007f0fcd6283aa clang::Parser::ParseMemInitializer(clang::Decl*) (/lib64/libclang-cpp.so.16+0x18283aa)
#13 0x00007f0fcd62744c clang::Parser::ParseConstructorInitializer(clang::Decl*) (/lib64/libclang-cpp.so.16+0x182744c)
#14 0x00007f0fcd6e7678 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/lib64/libclang-cpp.so.16+0x18e7678)
#15 0x00007f0fcd6033d7 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/lib64/libclang-cpp.so.16+0x18033d7)
#16 0x00007f0fcd6e48cc clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/lib64/libclang-cpp.so.16+0x18e48cc)
#17 0x00007f0fcd6e40c0 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/lib64/libclang-cpp.so.16+0x18e40c0)
#18 0x00007f0fcd6e2d6c clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/lib64/libclang-cpp.so.16+0x18e2d6c)
#19 0x00007f0fcd60ad1b clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/lib64/libclang-cpp.so.16+0x180ad1b)
#20 0x00007f0fcd609d96 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/lib64/libclang-cpp.so.16+0x1809d96)
#21 0x00007f0fcd60083c clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/lib64/libclang-cpp.so.16+0x180083c)
#22 0x00007f0fcd6e2856 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/lib64/libclang-cpp.so.16+0x18e2856)
#23 0x00007f0fcd60ad1b clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/lib64/libclang-cpp.so.16+0x180ad1b)
#24 0x00007f0fcd609d96 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/lib64/libclang-cpp.so.16+0x1809d96)
#25 0x00007f0fcd60083c clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/lib64/libclang-cpp.so.16+0x180083c)
#26 0x00007f0fcd6e2856 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/lib64/libclang-cpp.so.16+0x18e2856)
#27 0x00007f0fcd6e051e clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/lib64/libclang-cpp.so.16+0x18e051e)
#28 0x00007f0fcd5c116e clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.16+0x17c116e)
#29 0x00007f0fcfce75ad clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.16+0x3ee75ad)
#30 0x00007f0fcfc409b9 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.16+0x3e409b9)
#31 0x00007f0fcfd69a49 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.16+0x3f69a49)
#32 0x00005641e02cf8dd cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-16+0x1c8dd)
#33 0x00005641e02cafe8 (/usr/bin/clang-16+0x17fe8)
#34 0x00007f0fcf7d8c24 (/lib64/libclang-cpp.so.16+0x39d8c24)
#35 0x00007f0fc62966c3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/lib64/libLLVM-16.so+0x46966c3)
#36 0x00007f0fcf7d8a9d clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/lib64/libclang-cpp.so.16+0x39d8a9d)
#37 0x00007f0fcf77c6b0 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/lib64/libclang-cpp.so.16+0x397c6b0)
#38 0x00007f0fcf77cc9e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/lib64/libclang-cpp.so.16+0x397cc9e)
#39 0x00007f0fcf7d3bff clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/lib64/libclang-cpp.so.16+0x39d3bff)
#40 0x00005641e02c8e3e clang_main(int, char**) (/usr/bin/clang-16+0x15e3e)
#41 0x00007f0fc163d70a (/lib64/libc.so.6+0x2370a)
#42 0x00007f0fc163d7c5 __libc_start_main (/lib64/libc.so.6+0x237c5)
#43 0x00005641e02c5891 _start (/usr/bin/clang-16+0x12891)
clang-16: error: clang frontend command failed with exit code 134 (use -v to see invocation)
OpenMandriva 16.0.1-1 clang version 16.0.1 (/builddir/build/BUILD/llvm-project-16.0.1.src/clang 7c4a3845fb2bff853c458cb4ab0338ecefcf0c7e)
Target: x86_64-pc-linux
Thread model: posix
InstalledDir: /usr/bin
clang-16: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-16: note: diagnostic msg: /tmp/src-0c6dec.cpp
clang-16: note: diagnostic msg: /tmp/src-0c6dec.sh
clang-16: note: diagnostic msg:
********************
```
[src-0c6dec.cpp.txt](https://github.com/llvm/llvm-project/files/11239553/src-0c6dec.cpp.txt)
[src-0c6dec.sh.txt](https://github.com/llvm/llvm-project/files/11239556/src-0c6dec.sh.txt)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWs1y2ziQfhr6gqKKBPh78EGWrIxmldhrK5PMSQWCoIQNSXAB0JHz9FsAKZugbPknqand2bhcEkUA3V9_QHcDZGMp2bam9NwJL5xwfoZbtePiPKOCl6xu92cZz-_P1-Ke1VugOMhaVuYg41wq4E8SOPHAd6Z2gJS43gI_mngTHwgq21JJwGrHmzvetP-MvP6_-wmhGeTAC_MPgUuAuwekuwHc4o5JlrGSqXuX1SWrqXR3LM9pDdziejkDbhUFwG3UTlCcA_cLLkvgbq2BDpofhnypeS8GuFcSuAWvmHILgSvqNpzVigrgbhFwt_l3LAo3AO4XqQQjysUlw5LVWwfNIXAb1lDgfim4qLAC7hcqBBcOmnc3XElJK5i6B-58s7i6WS8Xf29urz7fzC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