Open ericniebler opened 8 months ago
@llvm/issue-subscribers-clang-frontend
Author: Eric Niebler (ericniebler)
The assertion we hit is the usual one about dependent expressions in the constexpr evaluator.
The expression in question is:
RequiresExpr 0x7fff64773878 '_Bool'
|-ParmVarDecl 0x7fff64773018 referenced __fun 'class (lambda at /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:3511:14) &&'
|-ParmVarDecl 0x7fff647730a8 referenced __as 'struct stdexec::__let::__let_t<struct stdexec::__receivers::set_value_t> &&'
|-ParmVarDecl 0x7fff64773138 referenced __as 'class (lambda at /home/eniebler/Code/stdexec/examples/hello_world.cpp:28:41) &&'
|-ParmVarDecl 0x7fff647731c8 referenced __as 'struct stdexec::__sexpr<class (lambda at /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:578:18)> &&'
`-SimpleRequirement 0x7fff64773840 dependent
`-CXXOperatorCallExpr 0x7fff647737f0 'auto' '()'
|-ImplicitCastExpr 0x7fff64773688 'auto (*)(__ignore, class (lambda at /home/eniebler/Code/stdexec/examples/hello_world.cpp:28:41) &&, struct stdexec::__sexpr<class (lambda at /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:578:18)> &&) const' <FunctionToPointerDecay>
| `-DeclRefExpr 0x7fff64773660 'auto (__ignore, class (lambda at /home/eniebler/Code/stdexec/examples/hello_world.cpp:28:41) &&, struct stdexec::__sexpr<class (lambda at /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:578:18)> &&) const' lvalue CXXMethod 0x7fff64734a50 'operator()' 'auto (__ignore, class (lambda at /home/eniebler/Code/stdexec/examples/hello_world.cpp:28:41) &&, struct stdexec::__sexpr<class (lambda at /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:578:18)> &&) const'
|-ImplicitCastExpr 0x7fff647736a8 'const class (lambda at /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:3511:14)' xvalue <NoOp>
| `-ParenExpr 0x7fff64773308 'class (lambda at /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:3511:14)' xvalue
| `-CStyleCastExpr 0x7fff647732d8 'class (lambda at /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:3511:14)' xvalue <NoOp>
| `-DeclRefExpr 0x7fff64773250 'class (lambda at /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:3511:14)' lvalue ParmVar 0x7fff64773018 '__fun' 'class (lambda at /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:3511:14) &&' non_odr_use_unevaluated
|-ImplicitCastExpr 0x7fff647737d0 '__ignore':'struct stdexec::__ignore' <ConstructorConversion>
| `-CXXConstructExpr 0x7fff64773798 '__ignore':'struct stdexec::__ignore' 'void (struct stdexec::__let::__let_t<struct stdexec::__receivers::set_value_t> &&) noexcept'
| `-CStyleCastExpr 0x7fff64773390 'struct stdexec::__let::__let_t<struct stdexec::__receivers::set_value_t>' xvalue <NoOp>
| `-DeclRefExpr 0x7fff64773348 'struct stdexec::__let::__let_t<struct stdexec::__receivers::set_value_t>' lvalue ParmVar 0x7fff647730a8 '__as' 'struct stdexec::__let::__let_t<struct stdexec::__receivers::set_value_t> &&' non_odr_use_unevaluated
|-CStyleCastExpr 0x7fff64773420 'class (lambda at /home/eniebler/Code/stdexec/examples/hello_world.cpp:28:41)' xvalue <NoOp>
| `-DeclRefExpr 0x7fff647733d8 'class (lambda at /home/eniebler/Code/stdexec/examples/hello_world.cpp:28:41)' lvalue ParmVar 0x7fff64773138 '__as' 'class (lambda at /home/eniebler/Code/stdexec/examples/hello_world.cpp:28:41) &&' non_odr_use_unevaluated
`-CStyleCastExpr 0x7fff647734b0 'struct stdexec::__sexpr<class (lambda at /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:578:18)>' xvalue <NoOp>
`-DeclRefExpr 0x7fff64773468 'struct stdexec::__sexpr<class (lambda at /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:578:18)>' lvalue ParmVar 0x7fff647731c8 '__as' 'struct stdexec::__sexpr<class (lambda at /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:578:18)> &&' non_odr_use_unevaluated
Confirmed on post-18 trunk: https://godbolt.org/z/3b8fdajsq Reduced by me and C-Reduce:
template < class >
template < class _Tp >
using __copy_cvref_fn = _Tp;
struct __sexpr {
template < class _Sender>
auto apply(_Sender) -> __copy_cvref_fn < _Sender >;
};
struct __sexpr_apply_t {
auto operator()() -> decltype(__sexpr{}.apply(0));
};
template < class _Fun >
concept __callable = requires (_Fun __fun) {
__fun();
};
void transform_sender() {
__callable< __sexpr_apply_t>;
}
Backtrace:
<source>:3:1: error: extraneous template parameter list in alias template declaration
2 | template < class _Tp >
| ~~~~~~~~~~~~~~~~~~~~~~
3 | using __copy_cvref_fn = _Tp;
| ^
clang++: /root/llvm-project/clang/lib/AST/ExprConstant.cpp:15674:
bool clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, const clang::ASTContext&, clang::Expr::ConstantExprKind) const:
Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' 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: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 <source>
1. <source>:20:31: current parser token ';'
2. <source>:19:25: parsing function body 'transform_sender'
3. <source>:19:25: in compound statement ('{}')
#0 0x000000000388a128 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x388a128)
#1 0x0000000003887e0c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3887e0c)
#2 0x00000000037d02e8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f2bfee42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f2bfee969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007f2bfee42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007f2bfee287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007f2bfee2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007f2bfee39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x0000000007311f98 clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, clang::ASTContext const&, clang::Expr::ConstantExprKind) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7311f98)
#10 0x000000000638adeb clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&&) SemaConcept.cpp:0:0
#11 0x000000000638b572 CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) SemaConcept.cpp:0:0
#12 0x000000000638bbaa clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x638bbaa)
#13 0x0000000006ab38a1 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*) (.constprop.0) SemaTemplate.cpp:0:0
#14 0x0000000006ab5794 clang::Sema::BuildTemplateIdExpr(clang::CXXScopeSpec const&, clang::SourceLocation, clang::LookupResult&, bool, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ab5794)
#15 0x000000000666d5fc clang::Sema::ActOnIdExpression(clang::Scope*, clang::CXXScopeSpec&, clang::SourceLocation, clang::UnqualifiedId&, bool, bool, clang::CorrectionCandidateCallback*, bool, clang::Token*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x666d5fc)
#16 0x0000000006158466 clang::Parser::tryParseCXXIdExpression(clang::CXXScopeSpec&, bool, clang::Token&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6158466)
#17 0x0000000006158784 clang::Parser::ParseCXXIdExpression(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6158784)
#18 0x000000000613a931 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x613a931)
#19 0x000000000613d28a clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x613d28a)
#20 0x000000000613d429 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x613d429)
#21 0x0000000006142069 clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6142069)
#22 0x00000000061bdb69 clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x61bdb69)
#23 0x00000000061b43b7 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x61b43b7)
#24 0x00000000061b5257 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x61b5257)
#25 0x00000000061b6161 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x61b6161)
#26 0x00000000061b7a7a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x61b7a7a)
#27 0x00000000060d3b21 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x60d3b21)
#28 0x000000000610a85c clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x610a85c)
#29 0x00000000060c7c1e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x60c7c1e)
#30 0x00000000060c83f1 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x60c83f1)
#31 0x00000000060cf6b6 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x60cf6b6)
#32 0x00000000060d055d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x60d055d)
#33 0x00000000060c341a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x60c341a)
#34 0x0000000004118c48 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4118c48)
#35 0x0000000004389719 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4389719)
#36 0x00000000043081ee clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43081ee)
#37 0x000000000446940e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x446940e)
#38 0x0000000000c126b6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc126b6)
#39 0x0000000000c09eca ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#40 0x000000000415a1f9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#41 0x00000000037d0794 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x37d0794)
#42 0x000000000415a7ef clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#43 0x00000000041224e5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x41224e5)
#44 0x0000000004122f4d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4122f4d)
#45 0x000000000412ae85 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x412ae85)
#46 0x0000000000c0fa3c clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc0fa3c)
#47 0x0000000000b06be4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xb06be4)
#48 0x00007f2bfee29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#49 0x00007f2bfee29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#50 0x0000000000c099ae _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc099ae)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
@llvm/issue-subscribers-c-20
Author: Eric Niebler (ericniebler)
Looks related to: https://github.com/llvm/llvm-project/issues/67058
Although, the code is not totally similar and that one is a crash on valid.
template < class >
template < class _Tp >
using __copy_cvref_fn = _Tp;
struct __sexpr {
template < class _Sender>
auto apply(_Sender) -> __copy_cvref_fn < _Sender >;
};
We ended up substituting into type alias __copy_cvref_fn
with [_Sender = int]
in Sema::CheckTemplateIdType
. The issue arose due to an extra template parameter list on the alias Decl. This resulted in the template parameter _Tp
living at depth 1, causing another off-by-one issue as we only had one template argument living at depth 0.
We can avoid the bogus substitution and the subsequent constraint check if the type alias Decl, as well as its underlying Decl, were set to invalid.
And we're not doing that currently.
We would have these diagnostics then:
/tmp/issue-77250.cpp:3:39: error: extraneous template parameter list in alias template declaration
3 | template <class> template <class _Tp> using __copy_cvref_fn = _Tp;
| ~~~~~~~~~~~~~~~~~~~~ ^
/tmp/issue-77250.cpp:10:43: error: no matching member function for call to 'apply'
10 | auto operator()() -> decltype(__sexpr{}.apply(0));
| ~~~~~~~~~~^~~~~
/tmp/issue-77250.cpp:16:27: warning: expression result unused [-Wunused-value]
16 | void transform_sender() { __callable<__sexpr_apply_t>; }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
Unfortunately, this still doesn't fix the crash from the report. The crashing parsing stack is as follows, with a different stacktrace from @Endilll's reduced example -- I suspect there are two (or more) issues here!
```txt
1. /home/eniebler/Code/stdexec/examples/hello_world.cpp:28:57: current parser token ')'
2. /home/eniebler/Code/stdexec/examples/hello_world.cpp:26:12: parsing function body 'main'
3. /home/eniebler/Code/stdexec/examples/hello_world.cpp:26:12: in compound statement ('{}')
4. /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:5386:12: instantiating class definition 'stdexec::__sync_wait::__value_tuple_for
Reduced by me and C-Reduce (https://godbolt.org/z/sx3znYhP9):
template < class >
concept _Ok = true;
template < bool >
struct __i {};
void __for_all_sigs_();
template < class _Variant >
using __for_all_sigs = __i< _Ok< decltype(__for_all_sigs_((_Variant *)0)) > >;
auto transform_sender_fn() -> __for_all_sigs<int>;
template < int >
requires requires { transform_sender_fn(); }
auto tuple() -> decltype(transform_sender_fn());
using T = decltype(tuple<0>());
Clang 20.0 crash:
<source>:10:43: error: no matching function for call to '__for_all_sigs_'
10 | using __for_all_sigs = __i< _Ok< decltype(__for_all_sigs_((_Variant *)0)) > >;
| ^~~~~~~~~~~~~~~
<source>:12:31: note: in instantiation of template type alias '__for_all_sigs' requested here
12 | auto transform_sender_fn() -> __for_all_sigs<int>;
| ^
<source>:7:6: note: candidate function not viable: requires 0 arguments, but 1 was provided
7 | void __for_all_sigs_();
| ^
clang++: /root/llvm-project/clang/lib/AST/ExprConstant.cpp:16193:
bool clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, const clang::ASTContext&, clang::Expr::ConstantExprKind) const:
Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' 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: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++2a <source>
1. <source>:18:29: current parser token ')'
#0 0x0000000003abe608 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3abe608)
#1 0x0000000003abc2fc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3abc2fc)
#2 0x0000000003a052f8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007968bf642520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007968bf6969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007968bf642476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007968bf6287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007968bf62871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007968bf639e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00000000078dcfa8 clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, clang::ASTContext const&, clang::Expr::ConstantExprKind) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x78dcfa8)
#10 0x00000000067ba7fe clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::ConstraintEvaluator>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::ConstraintEvaluator const&) SemaConcept.cpp:0:0
#11 0x00000000067bbe7e CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) SemaConcept.cpp:0:0
#12 0x00000000067bc4dd clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67bc4dd)
#13 0x00000000067bd52b clang::Sema::CheckInstantiatedFunctionTemplateConstraints(clang::SourceLocation, clang::FunctionDecl*, llvm::ArrayRef<clang::TemplateArgument>, clang::ConstraintSatisfaction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67bd52b)
#14 0x00000000070a6702 clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool, llvm::function_ref<bool ()>) (.constprop.0) SemaTemplateDeduction.cpp:0:0
#15 0x00000000070a710a void llvm::function_ref<void ()>::callback_fn<clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, bool, clang::QualType, clang::Expr::Classification, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>)::'lambda1'()>(long) SemaTemplateDeduction.cpp:0:0
#16 0x0000000006640431 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6640431)
#17 0x00000000070b2212 clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, bool, clang::QualType, clang::Expr::Classification, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x70b2212)
#18 0x0000000006ec4298 clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool, clang::CallExpr::ADLCallKind, clang::OverloadCandidateParamOrder, bool) (.constprop.1) SemaOverload.cpp:0:0
#19 0x0000000006ec4a9b AddOverloadedCallCandidate(clang::Sema&, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool) SemaOverload.cpp:0:0
#20 0x0000000006ec4d89 clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ec4d89)
#21 0x0000000006ec508e clang::Sema::buildOverloadedCallSet(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::OverloadCandidateSet*, clang::ActionResult<clang::Expr*, true>*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ec508e)
#22 0x0000000006ed17b5 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ed17b5)
#23 0x0000000006ac4788 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ac4788)
#24 0x0000000006ac6cec clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ac6cec)
#25 0x000000000654ecfd clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x654ecfd)
#26 0x0000000006547a81 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6547a81)
#27 0x0000000006547cee clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6547cee)
#28 0x0000000006549bda clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6549bda)
#29 0x0000000006549d79 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6549d79)
#30 0x000000000654e2b9 clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x654e2b9)
#31 0x000000000652ac5b clang::Parser::ParseDecltypeSpecifier(clang::DeclSpec&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x652ac5b)
#32 0x00000000065616cb clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&, clang::OpaquePtr<clang::QualType>, bool, bool, bool*, bool, clang::IdentifierInfo const**, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65616cb)
#33 0x00000000064d12ea clang::Parser::TryAnnotateCXXScopeToken(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64d12ea)
#34 0x0000000006516de6 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6516de6)
#35 0x0000000006518212 clang::Parser::ParseSpecifierQualifierList(clang::DeclSpec&, clang::ImplicitTypenameContext, clang::AccessSpecifier, clang::Parser::DeclSpecContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6518212)
#36 0x000000000651f1f0 clang::Parser::ParseTypeName(clang::SourceRange*, clang::DeclaratorContext, clang::AccessSpecifier, clang::Decl**, clang::ParsedAttributes*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x651f1f0)
#37 0x000000000652cb59 clang::Parser::ParseAliasDeclarationAfterDeclarator(clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation, clang::Parser::UsingDeclarator&, clang::SourceLocation&, clang::AccessSpecifier, clang::ParsedAttributes&, clang::Decl**) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x652cb59)
#38 0x000000000653664e clang::Parser::ParseUsingDeclaration(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x653664e)
#39 0x00000000065373a5 clang::Parser::ParseUsingDirectiveOrDeclaration(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65373a5)
#40 0x000000000651bbdf clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x651bbdf)
#41 0x00000000064d89e1 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64d89e1)
#42 0x00000000064d986d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64d986d)
#43 0x00000000064ccd3a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64ccd3a)
#44 0x00000000043d11d8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43d11d8)
#45 0x000000000465d109 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x465d109)
#46 0x00000000045e170e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45e170e)
#47 0x00000000047465de clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47465de)
#48 0x0000000000c9299f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc9299f)
#49 0x0000000000c8bb2a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#50 0x0000000004414819 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#51 0x0000000003a057a4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3a057a4)
#52 0x0000000004414e0f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#53 0x00000000043da9d5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43da9d5)
#54 0x00000000043db43d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43db43d)
#55 0x00000000043e3055 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43e3055)
#56 0x0000000000c8fcd5 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc8fcd5)
#57 0x0000000000b63ba4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xb63ba4)
#58 0x00007968bf629d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#59 0x00007968bf629e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#60 0x0000000000c8b5de _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc8b5de)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
Another reduction that triggers the same assertion (https://godbolt.org/z/W31qe9jYa):
struct __sexpr_uncurry_fn {
void operator()();
};
auto __make_tuple = []< class _Cvref, class _Fun >(_Cvref, _Fun) -> void
requires requires { _Fun{}(); } {};
template < class _As >
using __call_result_t = decltype(__make_tuple(0, _As{}));
using T = __call_result_t< __sexpr_uncurry_fn >;
Clang 20.0 crash is slightly different from the previous reduction:
clang++: /root/llvm-project/clang/lib/AST/ExprConstant.cpp:16193: bool clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, const clang::ASTContext&, clang::Expr::ConstantExprKind) const: Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' 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: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 <source>
1. <source>:11:11: at annotation token
#0 0x0000000003abe608 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3abe608)
#1 0x0000000003abc2fc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3abc2fc)
#2 0x0000000003a052f8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x000074f668e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000074f668e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x000074f668e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x000074f668e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x000074f668e2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x000074f668e39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00000000078dcfa8 clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, clang::ASTContext const&, clang::Expr::ConstantExprKind) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x78dcfa8)
#10 0x00000000067ba7fe clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::ConstraintEvaluator>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::ConstraintEvaluator const&) SemaConcept.cpp:0:0
#11 0x00000000067bbe7e CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) SemaConcept.cpp:0:0
#12 0x00000000067bc4dd clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67bc4dd)
#13 0x00000000067bd52b clang::Sema::CheckInstantiatedFunctionTemplateConstraints(clang::SourceLocation, clang::FunctionDecl*, llvm::ArrayRef<clang::TemplateArgument>, clang::ConstraintSatisfaction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67bd52b)
#14 0x00000000070a6702 clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool, llvm::function_ref<bool ()>) (.constprop.0) SemaTemplateDeduction.cpp:0:0
#15 0x00000000070a710a void llvm::function_ref<void ()>::callback_fn<clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, bool, clang::QualType, clang::Expr::Classification, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>)::'lambda1'()>(long) SemaTemplateDeduction.cpp:0:0
#16 0x0000000006640431 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6640431)
#17 0x00000000070b2212 clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, bool, clang::QualType, clang::Expr::Classification, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x70b2212)
#18 0x0000000006ec639d clang::Sema::AddMethodTemplateCandidate(clang::FunctionTemplateDecl*, clang::DeclAccessPair, clang::CXXRecordDecl*, clang::TemplateArgumentListInfo*, clang::QualType, clang::Expr::Classification, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, clang::OverloadCandidateParamOrder) (.constprop.0) SemaOverload.cpp:0:0
#19 0x0000000006ec6d21 clang::Sema::AddMethodCandidate(clang::DeclAccessPair, clang::QualType, clang::Expr::Classification, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, clang::OverloadCandidateParamOrder) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ec6d21)
#20 0x0000000006ed72e2 clang::Sema::BuildCallToObjectOfClassType(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ed72e2)
#21 0x0000000006ac4ccd clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ac4ccd)
#22 0x0000000006ac6cec clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ac6cec)
#23 0x0000000007169920 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
#24 0x000000000715d445 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
#25 0x000000000716e047 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#26 0x00000000071749fa clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#27 0x0000000007174b1c clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::QualType) SemaTemplateInstantiate.cpp:0:0
#28 0x00000000071767db clang::Sema::SubstType(clang::QualType, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x71767db)
#29 0x0000000006fad6e6 clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6fad6e6)
#30 0x0000000006fafaa7 clang::Sema::ActOnTemplateIdType(clang::Scope*, clang::CXXScopeSpec&, clang::SourceLocation, clang::OpaquePtr<clang::TemplateName>, clang::IdentifierInfo const*, clang::SourceLocation, clang::SourceLocation, llvm::MutableArrayRef<clang::ParsedTemplateArgument>, clang::SourceLocation, bool, bool, clang::ImplicitTypenameContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6fafaa7)
#31 0x00000000065d9e4b clang::Parser::AnnotateTemplateIdTokenAsType(clang::CXXScopeSpec&, clang::ImplicitTypenameContext, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65d9e4b)
#32 0x0000000006515492 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6515492)
#33 0x0000000006518212 clang::Parser::ParseSpecifierQualifierList(clang::DeclSpec&, clang::ImplicitTypenameContext, clang::AccessSpecifier, clang::Parser::DeclSpecContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6518212)
#34 0x000000000651f1f0 clang::Parser::ParseTypeName(clang::SourceRange*, clang::DeclaratorContext, clang::AccessSpecifier, clang::Decl**, clang::ParsedAttributes*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x651f1f0)
#35 0x000000000652cb59 clang::Parser::ParseAliasDeclarationAfterDeclarator(clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation, clang::Parser::UsingDeclarator&, clang::SourceLocation&, clang::AccessSpecifier, clang::ParsedAttributes&, clang::Decl**) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x652cb59)
#36 0x000000000653664e clang::Parser::ParseUsingDeclaration(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x653664e)
#37 0x00000000065373a5 clang::Parser::ParseUsingDirectiveOrDeclaration(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65373a5)
#38 0x000000000651bbdf clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x651bbdf)
#39 0x00000000064d89e1 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64d89e1)
#40 0x00000000064d986d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64d986d)
#41 0x00000000064ccd3a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64ccd3a)
#42 0x00000000043d11d8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43d11d8)
#43 0x000000000465d109 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x465d109)
#44 0x00000000045e170e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45e170e)
#45 0x00000000047465de clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47465de)
#46 0x0000000000c9299f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc9299f)
#47 0x0000000000c8bb2a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#48 0x0000000004414819 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#49 0x0000000003a057a4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3a057a4)
#50 0x0000000004414e0f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#51 0x00000000043da9d5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43da9d5)
#52 0x00000000043db43d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43db43d)
#53 0x00000000043e3055 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43e3055)
#54 0x0000000000c8fcd5 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc8fcd5)
#55 0x0000000000b63ba4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xb63ba4)
#56 0x000074f668e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#57 0x000074f668e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#58 0x0000000000c8b5de _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc8b5de)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
I suspect there are two (or more) issues here!
I don't know how many issues are there, but I ran into three more crashes while re-reducing this one, and then one of them lead me back to the crash in this issue. (Hence two reductions.) Wild.
@Endilll note the original reduction no longer crashes in trunk: https://godbolt.org/z/3b8fdajsq
@Endilll note the original reduction no longer crashes in trunk: https://godbolt.org/z/3b8fdajsq
Yes, but original reproduce is still crashing. Which was the reason Corentin pointed me out to this issue again.
Files attached hello_world-57224b.zip
Click to view stack trace
``` [build] PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. [build] Stack dump: [build] 0. Program arguments: /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp [build] 1. /home/eniebler/Code/stdexec/examples/hello_world.cpp:28:57: current parser token ')' [build] 2. /home/eniebler/Code/stdexec/examples/hello_world.cpp:26:12: parsing function body 'main' [build] 3. /home/eniebler/Code/stdexec/examples/hello_world.cpp:26:12: in compound statement ('{}') [build] 4. /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:5386:12: instantiating class definition 'stdexec::__sync_wait::__value_tuple_for