Skip to content

Assertion `!Unexpanded.empty() && "Unable to find unexpanded parameter packs"' failed. #12238

@TheLartians

Description

@TheLartians

I've been using the emsdk v1.39.20 for a while in some projects based on my ModernWasmStarter template, however, it seems when upgrading to any newer version, I'm getting an Assertion '!Unexpanded.empty() && "Unable to find unexpanded parameter packs"' failed. error.

I haven't had time yet to create a minimal reproducer, however I can easily get the error through building the subproject EmGlue. The error is reproducible on my local system and on GitHub Workflows.

Reproducer:

git clone https://github.com/TheLartians/EmGlue
emcmake cmake -HEmGlue -BEmGlue/build
cmake --build EmGlue/build
Full output

Cloning into 'EmGlue'...
remote: Enumerating objects: 195, done.
remote: Counting objects: 100% (195/195), done.
remote: Compressing objects: 100% (108/108), done.
remote: Total 195 (delta 78), reused 124 (delta 45), pack-reused 0
Receiving objects: 100% (195/195), 47.87 KiB | 11.97 MiB/s, done.
Resolving deltas: 100% (78/78), done.
configure: cmake -HEmGlue -BEmGlue/build -DCMAKE_TOOLCHAIN_FILE=/Users/lars/Documents/Development/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR="/Users/lars/Documents/Development/emsdk/node/12.18.1_64bit/bin/node"
-- CPM: adding package Glue@1.3.4 (/Users/lars/.cache/CPM/glue/9889420029a83e7f018adb91aa03c01fc95176f5)
-- CPM: Glue: adding package PackageProject.cmake@1.2 (/Users/lars/.cache/CPM/packageproject.cmake/647b2ccf5c064ff26832b4ada87e20395cd0ff2c)
-- CPM: Glue: adding package EasyIterator@1.4 (/Users/lars/.cache/CPM/easyiterator/034d91a47fb6cf2163274c9d60443f6cff409feb)
-- CPM: Glue: adding package Revisited@2.3 (/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e)
-- CPM: Glue: Revisited: adding package StaticTypeInfo@1.2 (/Users/lars/.cache/CPM/statictypeinfo/f50f96f1027af5f5ab4e5fe360882a633bf147bf)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/lars/Documents/Development/test/EmGlue/build
Scanning dependencies of target Glue
[ 14%] Building CXX object _deps/glue-build/CMakeFiles/Glue.dir/source/anymap.cpp.o
Assertion failed: (!Unexpanded.empty() && "Unable to find unexpanded parameter packs"), function DiagnoseUnexpandedParameterPack, file /b/s/w/ir/cache/builder/emscripten-releases/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp, line 407.
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: /Users/lars/Documents/Development/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=40 -D__EMSCRIPTEN_tiny__=0 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/libcxx -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/lib/libcxxabi/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/compat -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/libc -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/local/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/SSE -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/lib/compiler-rt/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/lib/libunwind/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/cache/wasm/include -DEMSCRIPTEN -fignore-exceptions -I/Users/lars/.cache/CPM/glue/9889420029a83e7f018adb91aa03c01fc95176f5/include -I/Users/lars/.cache/CPM/easyiterator/034d91a47fb6cf2163274c9d60443f6cff409feb/include -I/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e/include -I/Users/lars/.cache/CPM/statictypeinfo/f50f96f1027af5f5ab4e5fe360882a633bf147bf/include -std=gnu++17 -c /Users/lars/.cache/CPM/glue/9889420029a83e7f018adb91aa03c01fc95176f5/source/anymap.cpp -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/SDL -c -o CMakeFiles/Glue.dir/source/anymap.cpp.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr 
1.	/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e/include/revisited/any_function.h:160:59: current parser token ')'
2.	/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e/include/revisited/any_function.h:12:1: parsing namespace 'revisited'
3.	/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e/include/revisited/any_function.h:117:3: parsing struct/union/class body 'revisited::AnyFunction'
4.	/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e/include/revisited/any_function.h:157:71: parsing function body 'revisited::AnyFunction::operator()'
5.	/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e/include/revisited/any_function.h:157:71: in compound statement ('{}')
6.	/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e/include/revisited/any_function.h:158:31: lambda expression parsing
7.	/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e/include/revisited/any_function.h:158:37: in compound statement ('{}')
0  libLLVM.dylib            0x000000010e4cacb5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  libLLVM.dylib            0x000000010e4c9b38 llvm::sys::RunSignalHandlers() + 248
2  libLLVM.dylib            0x000000010e4ca170 llvm::sys::CleanupOnSignal(unsigned long) + 208
3  libLLVM.dylib            0x000000010e3e68ca (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) + 106
4  libLLVM.dylib            0x000000010e3e6a5d CrashRecoverySignalHandler(int) + 109
5  libsystem_platform.dylib 0x00007fff6b34f5fd _sigtramp + 29
6  libclang-cpp.dylib       0x0000000113de4cab UnoptArrays + 273531
7  libsystem_c.dylib        0x00007fff6b225808 abort + 120
8  libsystem_c.dylib        0x00007fff6b224ac6 err + 0
9  libclang-cpp.dylib       0x0000000112753c9e clang::Sema::DiagnoseUnexpandedParameterPack(clang::Expr*, clang::Sema::UnexpandedParameterPackContext) + 206
10 libclang-cpp.dylib       0x0000000112395e07 clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool, bool) + 71
11 libclang-cpp.dylib       0x00000001122dfb1a clang::Sema::ActOnCondition(clang::Scope*, clang::SourceLocation, clang::Expr*, clang::Sema::ConditionKind) + 346
12 libclang-cpp.dylib       0x000000011188dc02 clang::Parser::ParseCXXCondition(clang::ActionResult<clang::Stmt*, true>*, clang::SourceLocation, clang::Sema::ConditionKind, clang::Parser::ForRangeInfo*) + 3042
13 libclang-cpp.dylib       0x00000001118d938b clang::Parser::ParseParenExprOrCondition(clang::ActionResult<clang::Stmt*, true>*, clang::Sema::ConditionResult&, clang::SourceLocation, clang::Sema::ConditionKind, clang::SourceLocation*, clang::SourceLocation*) + 283
14 libclang-cpp.dylib       0x00000001118d3714 clang::Parser::ParseIfStatement(clang::SourceLocation*) + 612
15 libclang-cpp.dylib       0x00000001118d058b clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) + 2251
16 libclang-cpp.dylib       0x00000001118cfaac clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) + 204
17 libclang-cpp.dylib       0x00000001118d8be0 clang::Parser::ParseCompoundStatementBody(bool) + 1920
18 libclang-cpp.dylib       0x000000011188a30b clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) + 6139
19 libclang-cpp.dylib       0x00000001118876c0 clang::Parser::ParseLambdaExpression() + 208
20 libclang-cpp.dylib       0x000000011187468d clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) + 8045
21 libclang-cpp.dylib       0x000000011186e56e clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 174
22 libclang-cpp.dylib       0x0000000111895f87 clang::Parser::ParseBraceInitializer() + 711
23 libclang-cpp.dylib       0x0000000111895f70 clang::Parser::ParseBraceInitializer() + 688
24 libclang-cpp.dylib       0x000000011184137e clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) + 4446
25 libclang-cpp.dylib       0x000000011183e050 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 2400
26 libclang-cpp.dylib       0x0000000111838942 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) + 546
27 libclang-cpp.dylib       0x0000000111838258 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, clang::SourceLocation*) + 440
28 libclang-cpp.dylib       0x00000001118d00ce clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) + 1038
29 libclang-cpp.dylib       0x00000001118cfaac clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) + 204
30 libclang-cpp.dylib       0x00000001118d8be0 clang::Parser::ParseCompoundStatementBody(bool) + 1920
31 libclang-cpp.dylib       0x00000001118d9b4c clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 172
32 libclang-cpp.dylib       0x000000011182b8fe clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 734
33 libclang-cpp.dylib       0x000000011182a4ca clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 186
34 libclang-cpp.dylib       0x00000001118601d6 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int, clang::Decl*) + 2598
35 libclang-cpp.dylib       0x000000011185da85 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::Parser::ParsedAttributesWithRange&) + 6197
36 libclang-cpp.dylib       0x0000000111838f12 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 1074
37 libclang-cpp.dylib       0x00000001118f6017 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 135
38 libclang-cpp.dylib       0x00000001118f5d12 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 642
39 libclang-cpp.dylib       0x00000001118f4382 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 2450
40 libclang-cpp.dylib       0x0000000111856559 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 281
41 libclang-cpp.dylib       0x0000000111855df4 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) + 6036
42 libclang-cpp.dylib       0x0000000111838402 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, clang::SourceLocation*) + 866
43 libclang-cpp.dylib       0x00000001118f3aae clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 190
44 libclang-cpp.dylib       0x00000001118f22a6 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) + 1766
45 libclang-cpp.dylib       0x0000000111826a1d clang::ParseAST(clang::Sema&, bool, bool) + 509
46 libclang-cpp.dylib       0x000000011329d663 clang::FrontendAction::Execute() + 99
47 libclang-cpp.dylib       0x00000001132347b4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 2324
48 libclang-cpp.dylib       0x0000000113310b15 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1509
49 clang++                  0x000000010e3379d1 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1985
50 clang++                  0x000000010e335938 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) + 344
51 libclang-cpp.dylib       0x0000000112edb227 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const::$_1>(long) + 23
52 libLLVM.dylib            0x000000010e3e67dc llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 236
53 libclang-cpp.dylib       0x0000000112eda587 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const + 375
54 libclang-cpp.dylib       0x0000000112ea83ad clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const + 397
55 libclang-cpp.dylib       0x0000000112ea880d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) const + 125
56 libclang-cpp.dylib       0x0000000112ec18dc clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) + 396
57 clang++                  0x000000010e33524f main + 10575
58 libdyld.dylib            0x00007fff6b156cc9 start + 1
clang-12: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 12.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.tiyicn.workers.dev-llvm-llvm--project 13a3d88666e2162a91dfcae3824198c9ba74cc7b)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /Users/lars/Documents/Development/emsdk/upstream/bin
clang-12: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /var/folders/_d/fdgm1zz15533c569yh24jlsh0000gn/T/anymap-26f670.cpp
clang-12: note: diagnostic msg: /var/folders/_d/fdgm1zz15533c569yh24jlsh0000gn/T/anymap-26f670.sh
clang-12: note: diagnostic msg: Crash backtrace is located in
clang-12: note: diagnostic msg: /Users/lars/Library/Logs/DiagnosticReports/clang-12_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang-12: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang-12: note: diagnostic msg: 

********************
em++: error: '/Users/lars/Documents/Development/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=40 -D__EMSCRIPTEN_tiny__=0 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/libcxx -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/lib/libcxxabi/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/compat -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/libc -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/local/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/SSE -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/lib/compiler-rt/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/lib/libunwind/include -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/cache/wasm/include -DEMSCRIPTEN -fignore-exceptions -I/Users/lars/.cache/CPM/glue/9889420029a83e7f018adb91aa03c01fc95176f5/include -I/Users/lars/.cache/CPM/easyiterator/034d91a47fb6cf2163274c9d60443f6cff409feb/include -I/Users/lars/.cache/CPM/revisited/44808ea53e3e544d4b439e1b9088e66c24559b0e/include -I/Users/lars/.cache/CPM/statictypeinfo/f50f96f1027af5f5ab4e5fe360882a633bf147bf/include -std=gnu++17 -c /Users/lars/.cache/CPM/glue/9889420029a83e7f018adb91aa03c01fc95176f5/source/anymap.cpp -Xclang -isystem/Users/lars/Documents/Development/emsdk/upstream/emscripten/system/include/SDL -c -o CMakeFiles/Glue.dir/source/anymap.cpp.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (254)
make[2]: *** [_deps/glue-build/CMakeFiles/Glue.dir/source/anymap.cpp.o] Error 1
make[1]: *** [_deps/glue-build/CMakeFiles/Glue.dir/all] Error 2
make: *** [all] Error 2

My current workaround is to continue working with a lower version, however it would be nice to be able to upgrade eventually. Let me know if I can provide further info.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions