[llvm-bugs] [Bug 52288] New: Crash when specializing constrained template template parameter

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 24 18:46:16 PDT 2021


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

            Bug ID: 52288
           Summary: Crash when specializing constrained template template
                    parameter
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: johelegp at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    johelegp at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

See https://godbolt.org/z/8KM853aTT.

```C++
template<class> concept Auto = true;
template<template<Auto> class T> using _ = T<int>;
```

```
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
/app/output.s -mllvm --x86-asm-syntax=intel -S
--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics
-fno-crash-diagnostics -std=c++2b -pedantic -Wall -Wextra -stdlib=libc++
<source>
1.      <source>:2:44: at annotation token
 #0 0x00005559d01947bf PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00005559d0192680 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3592680)
 #2 0x00005559d00db568 CrashRecoverySignalHandler(int)
CrashRecoveryContext.cpp:0:0
 #3 0x00007f11e897b3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x00005559d2bbd2e7 clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous
namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*)
ExprConstant.cpp:0:0
 #5 0x00005559d2bb01f5 Evaluate(clang::APValue&, (anonymous
namespace)::EvalInfo&, clang::Expr const*) ExprConstant.cpp:0:0
 #6 0x00005559d2bc6626 EvaluateInPlace(clang::APValue&, (anonymous
namespace)::EvalInfo&, (anonymous namespace)::LValue const&, clang::Expr
const*, bool) ExprConstant.cpp:0:0
 #7 0x00005559d2bce24c
clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, clang::ASTContext
const&, clang::Expr::ConstantExprKind) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5fce24c)
 #8 0x00005559d2195a62 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*)&&)
SemaConcept.cpp:0:0
 #9 0x00005559d2196410
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+++0x5596410)
#10 0x00005559d219ef08
clang::Sema::EnsureTemplateArgumentListConstraints(clang::TemplateDecl*,
llvm::ArrayRef<clang::TemplateArgument>, clang::SourceRange)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x559ef08)
#11 0x00005559d2675b45
clang::Sema::CheckTemplateArgumentList(clang::TemplateDecl*,
clang::SourceLocation, clang::TemplateArgumentListInfo&, bool,
llvm::SmallVectorImpl<clang::TemplateArgument>&, bool, bool*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5a75b45)
#12 0x00005559d2678907 clang::Sema::CheckTemplateIdType(clang::TemplateName,
clang::SourceLocation, clang::TemplateArgumentListInfo&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5a78907)
#13 0x00005559d267a60f clang::Sema::ActOnTemplateIdType(clang::Scope*,
clang::CXXScopeSpec&, clang::SourceLocation,
clang::OpaquePtr<clang::TemplateName>, clang::IdentifierInfo*,
clang::SourceLocation, clang::SourceLocation,
llvm::MutableArrayRef<clang::ParsedTemplateArgument>, clang::SourceLocation,
bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5a7a60f)
#14 0x00005559d2044f7d
clang::Parser::AnnotateTemplateIdTokenAsType(clang::CXXScopeSpec&, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5444f7d)
#15 0x00005559d1fab772
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x53ab772)
#16 0x00005559d1fada11
clang::Parser::ParseSpecifierQualifierList(clang::DeclSpec&,
clang::AccessSpecifier, clang::Parser::DeclSpecContext)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x53ada11)
#17 0x00005559d1fa1242 clang::Parser::ParseTypeName(clang::SourceRange*,
clang::DeclaratorContext, clang::AccessSpecifier, clang::Decl**,
clang::ParsedAttributes*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x53a1242)
#18 0x00005559d1fba9dd
clang::Parser::ParseAliasDeclarationAfterDeclarator(clang::Parser::ParsedTemplateInfo
const&, clang::SourceLocation, clang::Parser::UsingDeclarator&,
clang::SourceLocation&, clang::AccessSpecifier, clang::ParsedAttributes&,
clang::Decl**) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x53ba9dd)
#19 0x00005559d1fc2c91
clang::Parser::ParseUsingDeclaration(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation,
clang::SourceLocation&, clang::ParsedAttributesWithRange&,
clang::AccessSpecifier)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x53c2c91)
#20 0x00005559d1fc3d95
clang::Parser::ParseUsingDirectiveOrDeclaration(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation&,
clang::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x53c3d95)
#21 0x00005559d20519cc
clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x54519cc)
#22 0x00005559d2055b44
clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5455b44)
#23 0x00005559d20564b4
clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x54564b4)
#24 0x00005559d1faf965
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributesWithRange&,
clang::SourceLocation*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x53af965)
#25 0x00005559d1f86dcb
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5386dcb)
#26 0x00005559d1f881c9
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x53881c9)
#27 0x00005559d1f7ba29 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x537ba29)
#28 0x00005559d1135d92 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4535d92)
#29 0x00005559d0ac4561 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3ec4561)
#30 0x00005559d0a607c2
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3e607c2)
#31 0x00005559d0b92733
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3f92733)
#32 0x00005559cdea387c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x12a387c)
#33 0x00005559cde9fa8d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#34 0x00005559d090b1d5 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) Job.cpp:0:0
#35 0x00005559d00dbb53
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x34dbb53)
#36 0x00005559d090d28e
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d0d28e)
#37 0x00005559d08e29ea
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3ce29ea)
#38 0x00005559d08e352f
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+++0x3ce352f)
#39 0x00005559d08eb9a5
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3ceb9a5)
#40 0x00005559cddb383e main
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x11b383e)
#41 0x00007f11e842b0b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#42 0x00005559cde9f60a _start
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x129f60a)
clang-14: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
Compiler returned: 139
```

-- 
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/20211025/862fa922/attachment-0001.html>


More information about the llvm-bugs mailing list