LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 36735 - Assertion failed while cross compiling on macOS for Linux [Assertion failed: (!CodeSynthesisContexts.empty() && "Cannot perform an instantiation without some context on the " "instantiation stack")]
Summary: Assertion failed while cross compiling on macOS for Linux [Assertion failed: ...
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: trunk
Hardware: PC MacOS X
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-14 09:52 PDT by Juan Arrieta
Modified: 2021-05-18 18:41 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juan Arrieta 2018-03-14 09:52:22 PDT
Successfully built clang from source exactly as instructed in https://clang.llvm.org/get_started.html.

Attempted to cross-compile a hello world executable.

Source (hello.cpp):

#include <iostream>
int main() {
  std::cout << "Hello, world!\n";
}


Command:

$ clang++ hello.cpp -std=c++17 -target x86_64-pc-linux -stdlib=libc++

Output:

In file included from hello.cpp:1:
In file included from /usr/local/bin/../include/c++/v1/iostream:37:
/usr/local/bin/../include/c++/v1/__config:192:12: fatal error: 'features.h' file not found
#  include <features.h>
           ^~~~~~~~~~~~
Assertion failed: (!CodeSynthesisContexts.empty() && "Cannot perform an instantiation without some context on the " "instantiation stack"), function SubstType, file /usr/local/src/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp, line 1580.
0  clang-7.0                0x000000010e3df8f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  clang-7.0                0x000000010e3dffb6 SignalHandler(int) + 470
2  libsystem_platform.dylib 0x00007fff5c1a8f5a _sigtramp + 26
3  libsystem_platform.dylib 0x00007ffee3108b10 _sigtramp + 2264267728
4  libsystem_c.dylib        0x00007fff5bfd3312 abort + 127
5  libsystem_c.dylib        0x00007fff5bf9b368 basename_r + 0
6  clang-7.0                0x000000010fbce3e4 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, bool) + 180
7  clang-7.0                0x000000010fc1155e clang::TemplateDeclInstantiator::VisitNonTypeTemplateParmDecl(clang::NonTypeTemplateParmDecl*) + 1086
8  clang-7.0                0x000000010fc162e2 clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) + 162
9  clang-7.0                0x000000010fb3101d clang::Sema::DeclareImplicitDeductionGuides(clang::TemplateDecl*, clang::SourceLocation) + 2173
10 clang-7.0                0x000000010fa03509 DeclareImplicitMemberFunctionsWithName(clang::Sema&, clang::DeclarationName, clang::SourceLocation, clang::DeclContext const*) + 521
11 clang-7.0                0x000000010fa076dd LookupDirect(clang::Sema&, clang::LookupResult&, clang::DeclContext const*) + 77
12 clang-7.0                0x000000010fa038ab CppNamespaceLookup(clang::Sema&, clang::LookupResult&, clang::ASTContext&, clang::DeclContext*, (anonymous namespace)::UnqualUsingDirectiveSet&) + 75
13 clang-7.0                0x000000010fa03209 clang::Sema::CppLookupName(clang::LookupResult&, clang::Scope*) + 3049
14 clang-7.0                0x000000010fa07259 clang::Sema::LookupName(clang::LookupResult&, clang::Scope*, bool) + 1337
15 clang-7.0                0x000000010f75ccda clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) + 2106
16 clang-7.0                0x000000010fb4c6cb clang::Sema::ActOnTemplateDeclarator(clang::Scope*, llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::Declarator&) + 27
17 clang-7.0                0x000000010f3fe93d clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) + 141
18 clang-7.0                0x000000010f48106a clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 2570
19 clang-7.0                0x000000010f480383 clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1283
20 clang-7.0                0x000000010f47fc2d clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 237
21 clang-7.0                0x000000010f3f7bbf clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 351
22 clang-7.0                0x000000010f48eb7e clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 174
23 clang-7.0                0x000000010f412380 clang::Parser::ParseInnerNamespace(std::__1::vector<clang::SourceLocation, std::__1::allocator<clang::SourceLocation> >&, std::__1::vector<clang::IdentifierInfo*, std::__1::allocator<clang::IdentifierInfo*> >&, std::__1::vector<clang::SourceLocation, std::__1::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 208
24 clang-7.0                0x000000010f411c96 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) + 5078
25 clang-7.0                0x000000010f3f7c77 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 535
26 clang-7.0                0x000000010f48eb7e clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 174
27 clang-7.0                0x000000010f412380 clang::Parser::ParseInnerNamespace(std::__1::vector<clang::SourceLocation, std::__1::allocator<clang::SourceLocation> >&, std::__1::vector<clang::IdentifierInfo*, std::__1::allocator<clang::IdentifierInfo*> >&, std::__1::vector<clang::SourceLocation, std::__1::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 208
28 clang-7.0                0x000000010f411c96 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) + 5078
29 clang-7.0                0x000000010f3f7c77 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 535
30 clang-7.0                0x000000010f48eb7e clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 174
31 clang-7.0                0x000000010f48e448 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 600
32 clang-7.0                0x000000010f3e9396 clang::ParseAST(clang::Sema&, bool, bool) + 438
33 clang-7.0                0x000000010ea38f3c clang::FrontendAction::Execute() + 76
34 clang-7.0                0x000000010e9f1451 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1233
35 clang-7.0                0x000000010ea863f8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1736
36 clang-7.0                0x000000010caf993b cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1499
37 clang-7.0                0x000000010caf75f7 main + 10903
38 libdyld.dylib            0x00007fff5bf27115 start + 1
39 libdyld.dylib            0x0000000000000037 start + 2752352035
Stack dump:
0.	Program arguments: /usr/local/bin/clang-7.0 -cc1 -triple x86_64-pc-linux -emit-obj -mrelax-all -disable-free -main-file-name hello.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -target-linker-version 305 -resource-dir /usr/local/lib/clang/7.0.0 -internal-isystem /usr/local/bin/../include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /usr/local/lib/clang/7.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++17 -fdeprecated-macro -fdebug-compilation-dir /Users/jarrieta -ferror-limit 19 -fmessage-length 200 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/96/gr2mgpnx277b7xmfmb1gs9440000gn/T/hello-c48a68.o -x c++ hello.cpp 
1.	/usr/local/bin/../include/c++/v1/utility:550:33: current parser token ';'
2.	/usr/local/bin/../include/c++/v1/utility:210:1 <Spelling=/usr/local/bin/../include/c++/v1/__config:454:37>: parsing namespace 'std'
3.	/usr/local/bin/../include/c++/v1/utility:210:1 <Spelling=/usr/local/bin/../include/c++/v1/__config:454:59>: parsing namespace 'std::__1'
clang-7.0: error: unable to execute command: Abort trap: 6
clang-7.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 7.0.0 (trunk 327528) (llvm/trunk 327527)
Target: x86_64-pc-linux
Thread model: posix
InstalledDir: /usr/local/bin
clang-7.0: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-7.0: note: diagnostic msg: Error generating preprocessed source(s).
Comment 1 Yilong Guo 2021-05-18 18:41:17 PDT
Encounter the same crash when compiling (not cross-compile) the hello-world program on MacOS (Big Sur).

Assertion failed because clang++ doesn't find 'wchar.h':

```
clang++ -v
# clang version 13.0.0 (https://github.com/llvm/llvm-project.git 6418bab6f8827960b9d161f5c9c2b8f9702c80e0)
# Target: x86_64-apple-darwin20.4.0
# Thread model: posix
# InstalledDir: /Users/nuullll/Projects/llvm-project/build/bin

clang++ test.cpp
# In file included from test.cpp:1:
# In file included from /usr/local/bin/../include/c++/v1/iostream:37:
# In file included from /usr/local/bin/../include/c++/v1/ios:214:
# In file included from /usr/local/bin/../include/c++/v1/iosfwd:98:
# /usr/local/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found
# #include_next <wchar.h>
#               ^~~~~~~~~
# Assertion failed: (!CodeSynthesisContexts.empty() && "Cannot perform an instantiation without some context on the " "instantiation stack"), function SubstType, file /Users/nuullll/Projects/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp, line 2071.
# PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
# Stack dump:
# 0.      Program arguments: /usr/local/bin/clang-13 -cc1 -triple x86_64-apple-macosx11.0.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all --mrelax-relocations -disable-free -main-file-name test.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-rounding-math -munwind-tables -fcompatibility-qualified-id-block-type-checking -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 556.6 -fcoverage-compilation-dir=/Users/nuullll/Projects/playground/cpp -resource-dir /usr/local/lib/clang/13.0.0 -stdlib=libc++ -internal-isystem /usr/local/bin/../include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /usr/local/lib/clang/13.0.0/include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir=/Users/nuullll/Projects/playground/cpp -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcolor-diagnostics -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /var/folders/33/3kb7_j8x61q5l57tn2wk4xl80000gn/T/test-25fb8d.o -x c++ test.cpp
# 1.      /usr/local/bin/../include/c++/v1/type_traits:1693:4: current parser token ':'
# 2.      /usr/local/bin/../include/c++/v1/type_traits:427:1 <Spelling=/usr/local/bin/../include/c++/v1/__config:789:37>: parsing namespace 'std'
# 3.      /usr/local/bin/../include/c++/v1/type_traits:427:1 <Spelling=/usr/local/bin/../include/c++/v1/__config:789:60>: parsing namespace 'std::__1'
# Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
# 0  clang-13                 0x000000010491bbdb llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
# 1  clang-13                 0x000000010491a858 llvm::sys::RunSignalHandlers() + 248
# 2  clang-13                 0x000000010491c247 SignalHandler(int) + 295
# 3  libsystem_platform.dylib 0x00007fff20525d7d _sigtramp + 29
# 4  libsystem_platform.dylib 0x0000000000000001 _sigtramp + 18446603339973894817
# 5  libsystem_c.dylib        0x00007fff20435411 abort + 120
# 6  libsystem_c.dylib        0x00007fff204347e8 err + 0
# 7  clang-13                 0x000000010895ce43 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, bool) (.cold.1) + 35
# 8  clang-13                 0x0000000106a458b1 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, bool) + 161
# 9  clang-13                 0x0000000106a4ceef clang::Sema::SubstParmVarDecl(clang::ParmVarDecl*, clang::MultiLevelTemplateArgumentList const&, int, llvm::Optional<unsigned int>, bool) + 367
# 10 clang-13                 0x0000000106a4e21a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionTypeParams(clang::SourceLocation, llvm::ArrayRef<clang::ParmVarDecl*>, clang::QualType const*, clang::FunctionType::ExtParameterInfo const*, llvm::SmallVectorImpl<clang::QualType>&, llvm::SmallVectorImpl<clang::ParmVarDecl*>*, clang::Sema::ExtParameterInfoBuilder&) + 1098
# 11 clang-13                 0x0000000106a74809 clang::QualType clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionProtoType<clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionProtoType(clang::TypeLocBuilder&, clang::FunctionProtoTypeLoc)::'lambda'(clang::FunctionProtoType::ExceptionSpecInfo&, bool&)>(clang::TypeLocBuilder&, clang::FunctionProtoTypeLoc, clang::CXXRecordDecl*, clang::Qualifiers, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionProtoType(clang::TypeLocBuilder&, clang::FunctionProtoTypeLoc)::'lambda'(clang::FunctionProtoType::ExceptionSpecInfo&, bool&)) + 1097
# 12 clang-13                 0x0000000106a48b7c clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) + 11340
# 13 clang-13                 0x0000000106a4655c clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) + 1580
# 14 clang-13                 0x0000000106a4640b clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) + 1243
# 15 clang-13                 0x0000000106a45c17 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) + 199
# 16 clang-13                 0x0000000106a6bcce clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCXXNamedCastExpr(clang::CXXNamedCastExpr*) + 30
# 17 clang-13                 0x0000000106a5edd7 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) + 71
# 18 clang-13                 0x0000000106a469ef clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) + 2751
# 19 clang-13                 0x0000000106a45c17 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) + 199
# 20 clang-13                 0x0000000106a6a9fe clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) + 270
# 21 clang-13                 0x0000000106a53b57 bool clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArguments<clang::TemplateArgumentLoc const*>(clang::TemplateArgumentLoc const*, clang::TemplateArgumentLoc const*, clang::TemplateArgumentListInfo&, bool) + 583
# 22 clang-13                 0x0000000106a4d861 clang::Sema::Subst(clang::TemplateArgumentLoc const*, unsigned int, clang::TemplateArgumentListInfo&, clang::MultiLevelTemplateArgumentList const&) + 81
# 23 clang-13                 0x0000000106a3c2cf std::__1::enable_if<IsPartialSpecialization<clang::ClassTemplatePartialSpecializationDecl>::value, clang::Sema::TemplateDeductionResult>::type FinishTemplateArgumentDeduction<clang::ClassTemplatePartialSpecializationDecl>(clang::Sema&, clang::ClassTemplatePartialSpecializationDecl*, bool, clang::TemplateArgumentList const&, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, clang::sema::TemplateDeductionInfo&) + 1695
# 24 clang-13                 0x0000000106a3f382 void llvm::function_ref<void ()>::callback_fn<bool isAtLeastAsSpecializedAs<clang::ClassTemplatePartialSpecializationDecl>(clang::Sema&, clang::QualType, clang::QualType, clang::ClassTemplatePartialSpecializationDecl*, clang::sema::TemplateDeductionInfo&)::'lambda'()>(long) + 66
# 25 clang-13                 0x000000010634f96e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
# 26 clang-13                 0x00000001069f1f4c bool isAtLeastAsSpecializedAs<clang::ClassTemplatePartialSpecializationDecl>(clang::Sema&, clang::QualType, clang::QualType, clang::ClassTemplatePartialSpecializationDecl*, clang::sema::TemplateDeductionInfo&) + 844
# 27 clang-13                 0x00000001069f23b1 clang::Sema::isMoreSpecializedThanPrimary(clang::ClassTemplatePartialSpecializationDecl*, clang::sema::TemplateDeductionInfo&) + 1009
# 28 clang-13                 0x0000000106958cf3 clang::Sema::CheckTemplatePartialSpecialization(clang::ClassTemplatePartialSpecializationDecl*) + 323
# 29 clang-13                 0x0000000106965ea3 clang::Sema::ActOnClassTemplateSpecialization(clang::Scope*, unsigned int, clang::Sema::TagUseKind, clang::SourceLocation, clang::SourceLocation, clang::CXXScopeSpec&, clang::TemplateIdAnnotation&, clang::ParsedAttributesView const&, llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::Sema::SkipBodyInfo*) + 4435
# 30 clang-13                 0x0000000106241078 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributesWithRange&) + 9352
# 31 clang-13                 0x000000010621b08f clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 991
# 32 clang-13                 0x00000001062cfbc0 clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) + 928
# 33 clang-13                 0x00000001062ceee1 clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) + 2161
# 34 clang-13                 0x00000001062ce4a9 clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) + 329
# 35 clang-13                 0x000000010621a566 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributesWithRange&, clang::SourceLocation*) + 694
# 36 clang-13                 0x00000001062e2c6e clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 190
# 37 clang-13                 0x000000010623911a clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 186
# 38 clang-13                 0x0000000106238aa8 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) + 7912
# 39 clang-13                 0x000000010621a630 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributesWithRange&, clang::SourceLocation*) + 896
# 40 clang-13                 0x00000001062e2c6e clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 190
# 41 clang-13                 0x000000010623911a clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 186
# 42 clang-13                 0x0000000106238aa8 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) + 7912
# 43 clang-13                 0x000000010621a630 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributesWithRange&, clang::SourceLocation*) + 896
# 44 clang-13                 0x00000001062e2c6e clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 190
# 45 clang-13                 0x00000001062e1421 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) + 2113
# 46 clang-13                 0x00000001062075dd clang::ParseAST(clang::Sema&, bool, bool) + 509
# 47 clang-13                 0x000000010528add9 clang::FrontendAction::Execute() + 169
# 48 clang-13                 0x00000001051f4de4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 948
# 49 clang-13                 0x000000010530a193 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1731
# 50 clang-13                 0x0000000102593cc3 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2531
# 51 clang-13                 0x000000010259154b ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) + 379
# 52 clang-13                 0x000000010259109e main + 12126
# 53 libdyld.dylib            0x00007fff204fbf3d start + 1
# 54 libdyld.dylib            0x000000000000003e start + 18446603339974066434
# clang-13: error: unable to execute command: Abort trap: 6
# clang-13: error: clang frontend command failed due to signal (use -v to see invocation)
# clang version 13.0.0 (https://github.com/llvm/llvm-project.git aab81c2f40d2098f9014473a1e7c8fb7b074360b)
# Target: x86_64-apple-darwin20.4.0
# Thread model: posix
# InstalledDir: /usr/local/bin
# clang-13: note: diagnostic msg: Error generating preprocessed source(s).
```

Details here: https://blog.nuullll.com/2021/05/15/building-llvm-project-with-ninja-on-macos.html