[llvm-bugs] [Bug 51252] New: ICE when using a concept in template parameter of a template template parameter

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 28 11:46:24 PDT 2021


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

            Bug ID: 51252
           Summary: ICE when using a concept in template parameter of a
                    template template parameter
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: blckcat at inbox.ru
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 25084
  --> https://bugs.llvm.org/attachment.cgi?id=25084&action=edit
backtrace, preprocessed source, and run script

Clang crashes when trying to compile following code. Clangd also crashes if
given it.

```
template <typename> concept C = true;
template <template <C> typename T> void f() {T<int> x;}
template <typename> struct S {};

int main()
{
    f<S>();
}
```

The top of the stacktrace is below. Full stacktrace and runner script are
attached.
```
1.      test.cpp:2:46: at annotation token
2.      test.cpp:2:45: parsing function body 'f'
3.      test.cpp:2:45: in compound statement ('{}')
 #0 0x00007f20e58ca283 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xbda283)
<...>
 #7 0x00007f20eb093ea2 clang::Expr::EvaluateAsRValue(clang::Expr::EvalResult&,
clang::ASTContext const&, bool) const
(/lib/x86_64-linux-gnu/libclang-cpp.so.12+0xbe2ea2)
 #8 0x00007f20eb515732 (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1064732)
 #9 0x00007f20eb510f25
clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*,
llvm::ArrayRef<clang::Expr const*>, llvm::ArrayRef<clang::TemplateArgument>,
clang::SourceRange, clang::ConstraintSatisfaction&)
(/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x105ff25)
#10 0x00007f20eb5117b1
clang::Sema::EnsureTemplateArgumentListConstraints(clang::TemplateDecl*,
llvm::ArrayRef<clang::TemplateArgument>, clang::SourceRange)
(/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x10607b1)
```

-- 
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/20210728/22aff596/attachment.html>


More information about the llvm-bugs mailing list