Closed ericniebler closed 8 months ago
@llvm/issue-subscribers-clang-frontend
This here adds a nullptr
initializer to the InitExprs
list.
One reduction appears to fixed in Clang 17: https://godbolt.org/z/Yaae7Tr43 Reduced by me and C-Reduce using assertions build:
template <class _Fn>
struct __conv {
friend void tag_invoke() noexcept {
constexpr bool _Nothrow = __nothrow_callable;
auto __query = [] () noexcept -> __result_t && {
return [] () noexcept(_Nothrow) {};
};
}
};
Clang 16 crash:
<source>:4:31: error: use of undeclared identifier '__nothrow_callable'
constexpr bool _Nothrow = __nothrow_callable;
^
<source>:5:38: error: unknown type name '__result_t'
auto __query = [] () noexcept -> __result_t && {
^
clang++: /root/llvm-project/clang/lib/Sema/SemaExprCXX.cpp:8269: void CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(clang::Expr*, clang::sema::LambdaScopeInfo*, clang::Sema&): Assertion `CurrentLSI->CallOperator == DC && "The current call operator must be synchronized with Sema's CurContext"' 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-16.0.0/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-12.2.0 -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 <source>
1. <source>:6:39: current parser token '{'
2. <source>:2:1: parsing struct/union/class body '__conv'
3. <source>:3:37: parsing function body 'tag_invoke'
4. <source>:3:37: in compound statement ('{}')
5. <source>:5:20: lambda expression parsing
6. <source>:5:52: in compound statement ('{}')
7. <source>:6:14: lambda expression parsing
#0 0x00005599b362b32f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x412e32f)
#1 0x00005599b36292cc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x412c2cc)
#2 0x00005599b3575fb8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f79a4a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f79a4a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007f79a4a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007f79a4a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007f79a4a2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007f79a4a39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00005599b6320b32 clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x6e23b32)
#10 0x00005599b6574982 CheckConvertedConstantExpression(clang::Sema&, clang::Expr*, clang::QualType, clang::APValue&, clang::Sema::CCEKind, bool, clang::NamedDecl*) SemaOverload.cpp:0:0
#11 0x00005599b657519c clang::Sema::CheckConvertedConstantExpression(clang::Expr*, clang::QualType, llvm::APSInt&, clang::Sema::CCEKind) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x707819c)
#12 0x00005599b6160b9c clang::Sema::ActOnNoexceptSpec(clang::Expr*, clang::ExceptionSpecificationType&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x6c63b9c)
#13 0x00005599b5cfc392 clang::Parser::tryParseExceptionSpecification(bool, clang::SourceRange&, llvm::SmallVectorImpl<clang::OpaquePtr<clang::QualType>>&, llvm::SmallVectorImpl<clang::SourceRange>&, clang::ActionResult<clang::Expr*, true>&, llvm::SmallVector<clang::Token, 4u>*&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67ff392)
#14 0x00005599b5d2f3b6 clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&)::'lambda0'(clang::SourceLocation, clang::SourceLocation, llvm::MutableArrayRef<clang::DeclaratorChunk::ParamInfo>, clang::SourceLocation)::operator()(clang::SourceLocation, clang::SourceLocation, llvm::MutableArrayRef<clang::DeclaratorChunk::ParamInfo>, clang::SourceLocation) const ParseExprCXX.cpp:0:0
#15 0x00005599b5d324c6 clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x68354c6)
#16 0x00005599b5d329db clang::Parser::ParseLambdaExpression() (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x68359db)
#17 0x00005599b5d120b2 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x68150b2)
#18 0x00005599b5d1410b clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x681710b)
#19 0x00005599b5d141ad clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x68171ad)
#20 0x00005599b5d1845d clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x681b45d)
#21 0x00005599b5d85a0a clang::Parser::ParseReturnStatement() (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x6888a0a)
#22 0x00005599b5d88d10 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x688bd10)
#23 0x00005599b5d8a2f5 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x688d2f5)
#24 0x00005599b5d8b2ca clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x688e2ca)
#25 0x00005599b5d31f6a clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x6834f6a)
#26 0x00005599b5d329db clang::Parser::ParseLambdaExpression() (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x68359db)
#27 0x00005599b5d120b2 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x68150b2)
#28 0x00005599b5d1410b clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x681710b)
#29 0x00005599b5d141ad clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x68171ad)
#30 0x00005599b5cd56fd clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67d86fd)
#31 0x00005599b5ce6a28 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67e9a28)
#32 0x00005599b5ce9781 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67ec781)
#33 0x00005599b5ce9bf9 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67ecbf9)
#34 0x00005599b5d89672 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x688c672)
#35 0x00005599b5d8a2f5 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x688d2f5)
#36 0x00005599b5d8b2ca clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x688e2ca)
#37 0x00005599b5d8cc7a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x688fc7a)
#38 0x00005599b5cbdd3a clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67c0d3a)
#39 0x00005599b5cbda1d clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67c0a1d)
#40 0x00005599b5d0871a clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributes&, unsigned int, clang::Decl*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x680b71a)
#41 0x00005599b5d0a7dd clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x680d7dd)
#42 0x00005599b5cdad60 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67ddd60)
#43 0x00005599b5d9da0f clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x68a0a0f)
#44 0x00005599b5dac37e clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (.part.0) ParseTemplate.cpp:0:0
#45 0x00005599b5dac613 clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x68af613)
#46 0x00005599b5ce9db0 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67ecdb0)
#47 0x00005599b5cb68c3 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67b98c3)
#48 0x00005599b5cb7e2d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67bae2d)
#49 0x00005599b5cb82f4 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67bb2f4)
#50 0x00005599b5cac18a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x67af18a)
#51 0x00005599b49ad3c8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x54b03c8)
#52 0x00005599b4218659 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x4d1b659)
#53 0x00005599b419f1ee clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x4ca21ee)
#54 0x00005599b42ffa83 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x4e02a83)
#55 0x00005599b0a562a6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x15592a6)
#56 0x00005599b0a52397 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#57 0x00005599b40073b9 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
#58 0x00005599b35764a0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x40794a0)
#59 0x00005599b4007c6f 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
#60 0x00005599b3fd030c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x4ad330c)
#61 0x00005599b3fd0d8d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x4ad3d8d)
#62 0x00005599b3fd9f5c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x4adcf5c)
#63 0x00005599b0a549f2 clang_main(int, char**) (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x15579f2)
#64 0x00007f79a4a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#65 0x00007f79a4a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#66 0x00005599b0a4d07e _start (/opt/compiler-explorer/clang-assertions-16.0.0/bin/clang+++0x155007e)
clang-16: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Another reduction seems to be fixed on post-18 trunk: https://godbolt.org/z/szP53x4q4 Partial reduction by me and C-Reduce:
template < int >
using enable_if_t = int;
template < typename _Tp, typename... _Args >
constexpr int is_constructible_v = __is_constructible(_Tp, _Args...);
template < typename , typename _Tp1>
struct _Nth_type {
using type = _Tp1;
};
template < typename... >
struct tuple{};
template < typename... _Types >
struct variant {
template <int _Np>
using __to_type = _Nth_type< _Types... >::type;
template < typename... _Args >
enable_if_t< is_constructible_v< __to_type< 0 >, _Args... > >
emplace(_Args ...);
};
namespace stdexec {
template < class _Tp >
_Tp &&__declval();
struct __cp {
template < class _Tp >
using __f = _Tp;
};
template < class _Ty class _Up >
concept __decays_to = true;
struct __ignore {
__ignore(auto);
};
struct __immovable {
__immovable(__immovable &&) = 0
};
template < class _Tp >
using __t = _Tp::__t;
template < class... _Args >
concept _Ok = true;
template < bool >
struct __i;
template < template < class... > typename _Fn, class... _Args >
using __meval = __i< _Ok< _Args... > >::template __g< _Fn, _Args... >;
template < class _Fn, class... _Args >
using __minvoke = __i< _Ok< _Fn > >::template __h< _Fn, _Args... >;
template < bool >
struct __i {
template < template < class... > typename _Fn, class... _Args >
using __g = _Fn< _Args... >;
template < class _Fn, class... _Args >
using __h = __meval< _Fn::template __f, _Args... >;
};
struct __q {};
template < class _Ty >
struct _Yp {
using __t = _Ty;
};
template < int = 0 >
struct __id_ {
template < class _Ty >
using __f = _Yp< _Ty >;
};
template < class _Ty >
using __id = __minvoke< __id_<>, _Ty >;
template < class _Fun, class... _As >
using __call_result_t = decltype(__declval< _Fun >()(__declval< _As >()...));
template < class _Fn >
struct __conv {
_Fn __fn_;
using __t = __call_result_t< _Fn >;
operator __t();
};
template < class _Fn >
__conv(_Fn) -> __conv< _Fn >;
struct __default_domain;
namespace __receivers {
struct set_value_t;
}
extern __receivers::set_value_t set_value;
struct connect_t;
extern connect_t connect;
template < class _Sender, class _Receiver >
using connect_result_t = __call_result_t< connect_t, _Sender, _Receiver >;
template < class _Sender >
using __impl_of = decltype(__declval< _Sender >().__impl_);
struct __get_tag {
template < class _Tag >
_Tag operator()(_Tag, ...);
};
template < class _ImplFn >
struct __sexpr {
__call_result_t< _ImplFn, __cp, __get_tag > __tag();
_ImplFn __impl_;
__sexpr(_ImplFn);
template < typename _Tag, typename _Self, class _Receiver >
friend auto tag_invoke(_Tag, _Self __self, _Receiver __rcvr)
-> decltype(__self.__tag().connect(__self, __rcvr));
template < class _Sender, class _ApplyFn >
auto apply(_Sender , _ApplyFn ) -> __call_result_t< __impl_of< _Sender >, __cp, _ApplyFn >;
};
template < class _Tag >
struct make_sender_expr_t {
template < class _Data , class... _Children >
constexpr auto operator()(_Data , _Children... ) const {
return __sexpr{__make_tuple(_Tag(),0)};
};
static constexpr auto __make_tuple
= []< class _Tag2, class... _Captures >(_Tag2, _Captures ...) {
return []< class _Cvref, class _Fun >(_Cvref, _Fun )
-> __call_result_t< _Fun, _Tag2, __minvoke< _Cvref, _Captures >... > {};
};
};
template < class _Tag >
make_sender_expr_t< _Tag > make_sender_expr;
struct apply_sender_t {
template < class _Sender, class _ApplyFn >
auto operator()(_Sender __sndr, _ApplyFn __fun) -> decltype(__sndr.apply(__sndr, __fun));
};
template < class _Tag, class... _Args >
using tag_invoke_result_t = decltype(tag_invoke(__declval< _Tag >(), __declval< _Args >()...)) ;
namespace __receivers {
struct set_value_t {
template < class _Receiver >
void operator()(_Receiver) {
tag_invoke(set_value_t{}, _Receiver{});
}
};
} // namespace __receivers
template < typename _Scheduler >
using schedule_result_t = _Scheduler ;
struct connect_t {
template < class _Sender, class _Receiver >
static auto __select_impl() {
using _Result = tag_invoke_result_t< connect_t, _Sender, _Receiver >;
return static_cast< _Result (*)() >(0);
}
template < class _Sender, class _Receiver >
using __select_impl_t = decltype(__select_impl< _Sender, _Receiver >());
template < typename _Sender, typename _Receiver >
auto operator()(_Sender , _Receiver ) -> __call_result_t< __select_impl_t< _Sender, _Receiver > >;
};
template < typename >
struct __operation {
struct __t : __immovable {};
};
template < typename , typename _Receiver >
struct __connect_fn {
template < class _Tuple >
auto operator()(__ignore, _Tuple ) -> __t<__operation< _Receiver > >;
};
template < typename , typename _SetTag >
struct __just_impl {
template < typename _Sender, typename _Receiver >
auto connect(_Sender , _Receiver )
-> __call_result_t< apply_sender_t, _Sender, __connect_fn< _SetTag, _Receiver > >;
};
struct __just_t : __just_impl< __just_t, __receivers::set_value_t > {
auto operator()() {
return make_sender_expr< __just_t >(__meval< tuple>{});
}
} just;
namespace {
template < typename _Derived >
struct receiver_adaptor {
struct __t {
template < class _Self >
static auto __call_set_value() {
_Self{}.set_value();
}
template < typename _SetValue >
friend auto tag_invoke(_SetValue, _Derived __self) {
__call_set_value<_Derived>();
}
};
};
}
template < typename _Derived>
using receiver_adaptor = receiver_adaptor< _Derived >::__t;
template < typename , typename >
struct Trans_NS_Trans_Anon_NS0___operation;
template < typename _SenderId >
struct __operation_base {
using _Sender = __t< _SenderId >;
_Sender __sndr_;
};
template < typename _SchedulerId, typename _SenderId >
struct __receiver {
struct __t : receiver_adaptor< __t > {
using __receiver_ref_t = int ;
stdexec::__t< Trans_NS_Trans_Anon_NS0___operation< _SchedulerId, _SenderId > > *__op_state_;
void set_value() {
__op_state->__data_.template emplace<>(__conv{[] {
return connect(__op_state_->__sndr_, 0);
}});
}
};
};
template < typename _SchedulerId, typename _SenderId >
struct Trans_NS_Trans_Anon_NS0___operation {
using _Scheduler = __t< _SchedulerId >;
using _Sender = __t< _SenderId >;
struct __t : __operation_base< _SenderId > {
using __receiver_t = stdexec::__t<__receiver< _SchedulerId, _SenderId > >;
variant<connect_result_t< _Scheduler, __receiver_t >,
connect_result_t< _Sender, __receiver_ref_t > > __data_;
};
};
template < typename _SchedulerId, typename _SenderId >
struct __sender {
struct __t {
using __operation_t = stdexec::__t<Trans_NS_Trans_Anon_NS0___operation< _SchedulerId, _SenderId > >;
template < typename _Self, typename _Receiver >
friend auto tag_invoke(connect_t, _Self, _Receiver ) -> __operation_t;
};
};
struct {
template < typename _Scheduler, typename _Sender >
auto operator()(_Scheduler , _Sender ) -> __t< __sender< __id< _Scheduler >, __id< _Sender > > >;
} on;
template < typename >
using __receiver_t = __q;
struct sync_wait_t {
struct __impl;
template < typename _Sender >
auto operator()(_Sender __sndr) const {
using __dispatcher_t = __impl ;
__dispatcher_t()(__sndr);
}
};
struct sync_wait_t::__impl {
template < typename _Sender >
auto operator()(_Sender __sndr) {
connect(__sndr, __q{});
}
static constexpr sync_wait_t sync_wait{};
struct static_thread_pool {
struct scheduler {
template < typename Receiver >
auto make_operation_(Receiver r) {
operation< __id< Receiver > >{pool_, r};
}
template <typename Sender, typename Receiver >
friend auto tag_invoke(connect_t, Sender s, Receiver r) {
s.make_operation_(r);
}
static_thread_pool &pool_;
};
template < typename ReceiverId >
struct operation {
using Receiver = __t< ReceiverId >;
operation(static_thread_pool, Receiver receiver_) {
set_value(receiver_);
scheduler sch;
sync_wait(on(sch, just()));
}
};
};
};
}
Clang 17 crash:
<source>:35:22: error: cannot combine with previous 'class' declaration specifier
35 | template < class _Ty class _Up >
| ^
<source>:35:32: error: non-type template parameter has incomplete type 'class _Ty'
35 | template < class _Ty class _Up >
| ^
<source>:35:18: note: forward declaration of 'stdexec::_Ty'
35 | template < class _Ty class _Up >
| ^
<source>:43:3: error: initializer on function does not look like a pure-specifier
43 | __immovable(__immovable &&) = 0
| ^ ~
<source>:43:34: error: expected ';' at end of declaration list
43 | __immovable(__immovable &&) = 0
| ^
| ;
<source>:247:16: error: reference to 'receiver_adaptor' is ambiguous
247 | struct __t : receiver_adaptor< __t > {
| ^
<source>:234:1: note: candidate found by name lookup is 'stdexec::receiver_adaptor'
234 | using receiver_adaptor = receiver_adaptor< _Derived >::__t;
| ^
<source>:217:8: note: candidate found by name lookup is 'stdexec::(anonymous namespace)::receiver_adaptor'
217 | struct receiver_adaptor {
| ^
<source>:251:7: error: use of undeclared identifier '__op_state'; did you mean '__op_state_'?
251 | __op_state->__data_.template emplace<>(__conv{[] {
| ^~~~~~~~~~
| __op_state_
<source>:249:85: note: '__op_state_' declared here
249 | stdexec::__t< Trans_NS_Trans_Anon_NS0___operation< _SchedulerId, _SenderId > > *__op_state_;
| ^
<source>:252:24: error: 'this' cannot be implicitly captured in this context
252 | return connect(__op_state_->__sndr_, 0);
| ^
<source>:251:54: note: explicitly capture 'this'
251 | __op_state->__data_.template emplace<>(__conv{[] {
| ^
| this
<source>:267:40: error: unknown type name '__receiver_ref_t'; did you mean '__receiver_t'?
267 | connect_result_t< _Sender, __receiver_ref_t > > __data_;
| ^~~~~~~~~~~~~~~~
| __receiver_t
<source>:264:11: note: '__receiver_t' declared here
264 | using __receiver_t = stdexec::__t<__receiver< _SchedulerId, _SenderId > >;
| ^
<source>:296:5: error: invalid use of incomplete type '__dispatcher_t' (aka 'stdexec::sync_wait_t::__impl')
296 | __dispatcher_t()(__sndr);
| ^~~~~~~~~~~~~~~~
<source>:291:10: note: forward declaration of 'stdexec::sync_wait_t::__impl'
291 | struct __impl;
| ^
<source>:328:19: error: call to implicitly-deleted default constructor of 'scheduler'
328 | scheduler sch;
| ^
<source>:320:27: note: default constructor of 'scheduler' is implicitly deleted because field 'pool_' of reference type 'static_thread_pool &' would not be initialized
320 | static_thread_pool &pool_;
| ^
<source>:252:24: error: 'this' cannot be implicitly captured in this context
252 | return connect(__op_state_->__sndr_, 0);
| ^
<source>:251:53: note: while substituting into a lambda expression here
251 | __op_state->__data_.template emplace<>(__conv{[] {
| ^
<source>:221:15: note: in instantiation of member function 'stdexec::__receiver<stdexec::_Yp<stdexec::sync_wait_t::__impl::static_thread_pool::scheduler>, stdexec::_Yp<stdexec::__sexpr<(lambda at <source>:145:18)>>>::__t::set_value' requested here
221 | _Self{}.set_value();
| ^
<source>:327:9: note: in instantiation of function template specialization 'stdexec::__receivers::set_value_t::operator()<stdexec::__receiver<stdexec::_Yp<stdexec::sync_wait_t::__impl::static_thread_pool::scheduler>, stdexec::_Yp<stdexec::__sexpr<(lambda at <source>:145:18)>>>::__t>' requested here
327 | set_value(receiver_);
| ^
<source>:312:9: note: in instantiation of member function 'stdexec::sync_wait_t::__impl::static_thread_pool::operation<stdexec::_Yp<stdexec::__receiver<stdexec::_Yp<stdexec::sync_wait_t::__impl::static_thread_pool::scheduler>, stdexec::_Yp<stdexec::__sexpr<(lambda at <source>:145:18)>>>::__t>>::operation' requested here
312 | operation< __id< Receiver > >{pool_, r};
| ^
<source>:251:54: note: explicitly capture 'this'
251 | __op_state->__data_.template emplace<>(__conv{[] {
| ^
| this
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-17.0.1/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-13.2.0 -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 -ferror-limit=0 <source>
1. <eof> parser at end of file
2. <source>:326:7: instantiating function definition 'stdexec::sync_wait_t::__impl::static_thread_pool::operation<stdexec::_Yp<stdexec::__receiver<stdexec::_Yp<stdexec::sync_wait_t::__impl::static_thread_pool::scheduler>, stdexec::_Yp<stdexec::__sexpr<(lambda at <source>:145:18)>>>::__t>>::operation'
3. <source>:166:8: instantiating function definition 'stdexec::__receivers::set_value_t::operator()<stdexec::__receiver<stdexec::_Yp<stdexec::sync_wait_t::__impl::static_thread_pool::scheduler>, stdexec::_Yp<stdexec::__sexpr<(lambda at <source>:145:18)>>>::__t>'
4. <source>:250:10: instantiating function definition 'stdexec::__receiver<stdexec::_Yp<stdexec::sync_wait_t::__impl::static_thread_pool::scheduler>, stdexec::_Yp<stdexec::__sexpr<(lambda at <source>:145:18)>>>::__t::set_value'
5. <source>:5:15: instantiating variable definition 'is_constructible_v<stdexec::__operation<stdexec::__receiver<stdexec::_Yp<stdexec::sync_wait_t::__impl::static_thread_pool::scheduler>, stdexec::_Yp<stdexec::__sexpr<(lambda at <source>:145:18)>>>::__t>::__t, stdexec::__conv<(lambda at <source>:251:53)>>'
#0 0x00000000036e7558 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x36e7558)
#1 0x00000000036e53dc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x36e53dc)
#2 0x0000000003632918 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f6f9be42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x0000000006e10e4f clang::computeDependence(clang::CXXParenListInitExpr*) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x6e10e4f)
#5 0x0000000006f70c81 clang::CXXParenListInitExpr::Create(clang::ASTContext&, llvm::ArrayRef<clang::Expr*>, clang::QualType, unsigned int, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x6f70c81)
#6 0x0000000006536954 TryOrBuildParenListInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::ArrayRef<clang::Expr*>, clang::InitializationSequence&, bool, clang::ActionResult<clang::Expr*, true>*) SemaInit.cpp:0:0
#7 0x0000000006532a28 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x6532a28)
#8 0x000000000647c167 EvaluateBooleanTypeTrait(clang::Sema&, clang::TypeTrait, clang::SourceLocation, llvm::ArrayRef<clang::TypeSourceInfo*>, clang::SourceLocation, bool) SemaExprCXX.cpp:0:0
#9 0x000000000647c8c9 clang::Sema::BuildTypeTrait(clang::TypeTrait, clang::SourceLocation, llvm::ArrayRef<clang::TypeSourceInfo*>, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x647c8c9)
#10 0x00000000068fa679 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTypeTraitExpr(clang::TypeTraitExpr*) SemaTemplateInstantiate.cpp:0:0
#11 0x00000000068eab00 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
#12 0x00000000068eb978 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformInitializer(clang::Expr*, bool) (.part.0) SemaTemplateInstantiate.cpp:0:0
#13 0x00000000068ebed1 clang::Sema::SubstInitializer(clang::Expr*, clang::MultiLevelTemplateArgumentList const&, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x68ebed1)
#14 0x000000000693097e clang::Sema::InstantiateVariableInitializer(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x693097e)
#15 0x0000000006930d7e clang::Sema::CompleteVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x6930d7e)
#16 0x0000000006971cde clang::Sema::InstantiateVariableDefinition(clang::SourceLocation, clang::VarDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x6971cde)
#17 0x0000000005f3c081 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x5f3c081)
#18 0x00000000063352e2 DoMarkVarDeclReferenced(clang::Sema&, clang::SourceLocation, clang::VarDecl*, clang::Expr*, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*, void>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) SemaExpr.cpp:0:0
#19 0x00000000063611d1 MarkExprReferenced(clang::Sema&, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*, void>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) SemaExpr.cpp:0:0
#20 0x00000000063617c6 clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&, clang::NestedNameSpecifierLoc, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x63617c6)
#21 0x0000000006361fbc clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&, clang::CXXScopeSpec const*, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x6361fbc)
#22 0x0000000006367451 clang::Sema::BuildDeclarationNameExpr(clang::CXXScopeSpec const&, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::NamedDecl*, clang::TemplateArgumentListInfo const*, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x6367451)
#23 0x00000000067a1644 clang::Sema::CheckVarTemplateId(clang::CXXScopeSpec const&, clang::DeclarationNameInfo const&, clang::VarTemplateDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x67a1644)
#24 0x00000000067a619a clang::Sema::BuildTemplateIdExpr(clang::CXXScopeSpec const&, clang::SourceLocation, clang::LookupResult&, bool, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x67a619a)
#25 0x000000000690a961 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformUnresolvedLookupExpr(clang::UnresolvedLookupExpr*) SemaTemplateInstantiate.cpp:0:0
#26 0x00000000068eab9f clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
#27 0x00000000068eaf48 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
#28 0x0000000006902683 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) SemaTemplateInstantiate.cpp:0:0
#29 0x0000000006905bd8 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) SemaTemplateInstantiate.cpp:0:0
#30 0x00000000068f9671 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#31 0x000000000690db9d clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformElaboratedType(clang::TypeLocBuilder&, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
#32 0x00000000068f932e clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#33 0x000000000691570a clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x691570a)
#34 0x000000000692f5d2 clang::TemplateDeclInstantiator::SubstFunctionType(clang::FunctionDecl*, llvm::SmallVectorImpl<clang::ParmVarDecl*>&) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x692f5d2)
#35 0x000000000697d00a clang::TemplateDeclInstantiator::VisitCXXMethodDecl(clang::CXXMethodDecl*, clang::TemplateParameterList*, std::optional<clang::ASTTemplateArgumentListInfo const*>, clang::TemplateDeclInstantiator::RewriteKind) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x697d00a)
#36 0x000000000697ed94 void llvm::function_ref<void ()>::callback_fn<clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)::'lambda'()>(long) SemaTemplateInstantiateDecl.cpp:0:0
#37 0x0000000005f3c081 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x5f3c081)
#38 0x000000000692f46a clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x692f46a)
#39 0x00000000068aa879 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 ()>) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x68aa879)
#40 0x00000000068ac8ba 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, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>)::'lambda1'()>(long) SemaTemplateDeduction.cpp:0:0
#41 0x0000000005f3c081 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x5f3c081)
#42 0x00000000068b62f2 clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, bool, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x68b62f2)
#43 0x00000000066cc938 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) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x66cc938)
#44 0x00000000066e02d2 clang::Sema::BuildCallToMemberFunction(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x66e02d2)
#45 0x000000000638e7e6 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x638e7e6)
#46 0x0000000006390d3c clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x6390d3c)
#47 0x00000000068f4940 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
#48 0x00000000068eafe2 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
#49 0x0000000006920ccf clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
#50 0x0000000006921ee8 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
#51 0x000000000692512a clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x692512a)
#52 0x00000000069740fb clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x69740fb)
#53 0x00000000069724df clang::Sema::PerformPendingInstantiations(bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x69724df)
#54 0x00000000069743b6 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x69743b6)
#55 0x00000000069724df clang::Sema::PerformPendingInstantiations(bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x69724df)
#56 0x00000000069743b6 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x69743b6)
#57 0x00000000069724df clang::Sema::PerformPendingInstantiations(bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x69724df)
#58 0x0000000005f5f4c9 clang::Sema::ActOnEndOfTranslationUnitFragment(clang::Sema::TUFragmentKind) (.part.0) Sema.cpp:0:0
#59 0x0000000005f5fca2 clang::Sema::ActOnEndOfTranslationUnit() (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x5f5fca2)
#60 0x0000000005df75f3 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x5df75f3)
#61 0x0000000005deb76a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x5deb76a)
#62 0x0000000004939258 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x4939258)
#63 0x00000000041a1c09 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x41a1c09)
#64 0x00000000041278ce clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x41278ce)
#65 0x0000000004281de6 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x4281de6)
#66 0x0000000000bc67eb cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0xbc67eb)
#67 0x0000000000bbefaa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#68 0x0000000003f83419 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
#69 0x0000000003632dc4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x3632dc4)
#70 0x0000000003f83a0f 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
#71 0x0000000003f4b275 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x3f4b275)
#72 0x0000000003f4bcdd clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x3f4bcdd)
#73 0x0000000003f5385d clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0x3f5385d)
#74 0x0000000000bc4a87 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0xbc4a87)
#75 0x0000000000abef61 main (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0xabef61)
#76 0x00007f6f9be29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#77 0x00007f6f9be29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#78 0x0000000000bbea8e _start (/opt/compiler-explorer/clang-assertions-17.0.1/bin/clang+++0xbbea8e)
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
@llvm/issue-subscribers-c-20
Author: Eric Niebler (ericniebler)
I believe the code is valid.
hello_world.zip