[llvm-bugs] [Bug 47025] New: [concepts] ICE on invalid code, in CheckParameterPacksForExpansion, on pack expansions in requires-expression

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 6 21:22:26 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47025

            Bug ID: 47025
           Summary: [concepts] ICE on invalid code, in
                    CheckParameterPacksForExpansion, on pack expansions in
                    requires-expression
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arthur.j.odwyer at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

// https://godbolt.org/z/Tro9dM
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
(https://github.com/llvm/llvm-project.git
9f717d7b941fbc42bef017b84c4dd0f65ce06e7a)) "-std=c++20".


PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /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>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
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>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200807/421bd4a1/attachment.html>


More information about the llvm-bugs mailing list