<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [concepts] ICE on invalid code, in CheckParameterPacksForExpansion, on pack expansions in requires-expression"
href="https://bugs.llvm.org/show_bug.cgi?id=47025">47025</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[concepts] ICE on invalid code, in CheckParameterPacksForExpansion, on pack expansions in requires-expression
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>arthur.j.odwyer@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>// <a href="https://godbolt.org/z/Tro9dM">https://godbolt.org/z/Tro9dM</a>
template<typename... Args>
concept PackHasAdd = (requires(Args... args) {
(args+1);
} && ...);
static_assert(PackHasAdd<int>);
int main() {}
Compile with Clang trunk (clang version 12.0.0
(<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
9f717d7b941fbc42bef017b84c4dd0f65ce06e7a)) "-std=c++20".
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-trunk/bin/clang++ -g -o
./output.s -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0
-fcolor-diagnostics -fno-crash-diagnostics -std=c++20 <source>
1. <source>:7:30: current parser token ')'
#0 0x000055fafe3d218a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2d0018a)
#1 0x000055fafe3cff34 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2cfdf34)
#2 0x000055fafe3d01a5 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2cfe1a5)
#3 0x000055fafe344720 CrashRecoverySignalHandler(int)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2c72720)
#4 0x00007f942cb508a0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x128a0)
#5 0x000055fb007135a0
clang::LocalInstantiationScope::findInstantiationOf(clang::Decl const*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x50415a0)
#6 0x000055fb00764aa4
clang::Sema::CheckParameterPacksForExpansion(clang::SourceLocation,
clang::SourceRange,
llvm::ArrayRef<std::pair<llvm::PointerUnion<clang::TemplateTypeParmType const*,
clang::NamedDecl*>, clang::SourceLocation> >,
clang::MultiLevelTemplateArgumentList const&, bool&, bool&,
llvm::Optional<unsigned int>&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5092aa4)
#7 0x000055fb0071f52e clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCXXFoldExpr(clang::CXXFoldExpr*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x504d52e)
#8 0x000055fb0071935f clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x504735f)
#9 0x000055fb00722186 clang::Sema::SubstExpr(clang::Expr*,
clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5050186)
#10 0x000055fb001d063f calculateConstraintSatisfaction(clang::Sema&,
clang::NamedDecl const*, llvm::ArrayRef<clang::TemplateArgument>,
clang::SourceLocation, clang::MultiLevelTemplateArgumentList&, clang::Expr
const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr
const*)::operator()(clang::Expr const*) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4afe63f)
#11 0x000055fb001d21a3 bool
calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&,
clang::NamedDecl const*, llvm::ArrayRef<clang::TemplateArgument>,
clang::SourceLocation, clang::MultiLevelTemplateArgumentList&, clang::Expr
const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr
const*)>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&,
calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*,
llvm::ArrayRef<clang::TemplateArgument>, clang::SourceLocation,
clang::MultiLevelTemplateArgumentList&, clang::Expr const*,
clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4b001a3)
#12 0x000055fb001d2f80
clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*,
llvm::ArrayRef<clang::Expr const*>, llvm::ArrayRef<clang::TemplateArgument>,
clang::SourceRange, clang::ConstraintSatisfaction&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4b00f80)
#13 0x000055fb00641382 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec
const&, clang::SourceLocation, clang::DeclarationNameInfo const&,
clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4f6f382)
#14 0x000055fb00645c7e clang::Sema::BuildTemplateIdExpr(clang::CXXScopeSpec
const&, clang::SourceLocation, clang::LookupResult&, bool,
clang::TemplateArgumentListInfo const*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4f73c7e)
#15 0x000055fb0036bcf3 clang::Sema::ActOnIdExpression(clang::Scope*,
clang::CXXScopeSpec&, clang::SourceLocation, clang::UnqualifiedId&, bool, bool,
clang::CorrectionCandidateCallback*, bool, clang::Token*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4c99cf3)
#16 0x000055fb0005adc7
clang::Parser::tryParseCXXIdExpression(clang::CXXScopeSpec&, bool,
clang::Token&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4988dc7)
#17 0x000055fb0005aff2 clang::Parser::ParseCXXIdExpression(bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4988ff2)
#18 0x000055fb00040f77
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x496ef77)
#19 0x000055fb00041d4f
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x496fd4f)
#20 0x000055fb00043436
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool,
clang::Parser::TypeCastState, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4971436)
#21 0x000055fb000487c5
clang::Parser::ParseConstantExpressionInExprEvalContext(clang::Parser::TypeCastState)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x49767c5)
#22 0x000055fb0002ca6f
clang::Parser::ParseStaticAssertDeclaration(clang::SourceLocation&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x495aa6f)
#23 0x000055fb00023328
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4951328)
#24 0x000055faffffeb9b
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x492cb9b)
#25 0x000055fb00000289
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x492e289)
#26 0x000055faffff3ef9 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4921ef9)
#27 0x000055fafebc7719 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x34f5719)
#28 0x000055fafeb813cb
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x34af3cb)
#29 0x000055fafec8db0b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x35bbb0b)
#30 0x000055fafc58ef0c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xebcf0c)
#31 0x000055fafc58ba0d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xeb9a0d)
#32 0x000055fafea58cf5 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const::'lambda'()>(long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3386cf5)
#33 0x000055fafe344803
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2c72803)
#34 0x000055fafea597d0
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const (.part.148)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x33877d0)
#35 0x000055fafea337e5
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x33617e5)
#36 0x000055fafea3422f
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x336222f)
#37 0x000055fafea3cdc5
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x336adc5)
#38 0x000055fafc4ca6e1 main
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xdf86e1)
#39 0x00007f942ba0eb97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#40 0x000055fafc58b58a _start
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xeb958a)
clang-12: error: clang frontend command failed due to signal (use -v to see
invocation)
Compiler returned: 254</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>