<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 - deserialization crash on checking concept-related TemplateParameters"
   href="https://bugs.llvm.org/show_bug.cgi?id=46790">46790</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>deserialization crash on checking concept-related TemplateParameters
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>hokein@google.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>$ cat /tmp/t2.cpp

#ifndef HEADER
#define HEADER

template <typename T, typename U>
concept not_same_as = true;

template <int Kind>
struct subrange {
  template <not_same_as<int> R>
  subrange(R) requires (Kind == 0);

  template <not_same_as<int> R>
  subrange(R) requires (Kind != 0);
};

template <typename R>
subrange(R) -> subrange<42>;

int main() {
    int c[3];
    subrange s(c);
}

$ ./bin/clang -cc1 -emit-pch -std=c++2a -o /tmp/pch /tmp/t2.cpp
$ ./bin/clang -cc1 -include-pch /tmp/pch -std=c++2a -emit-llvm -o - /tmp/t2.cpp 

LEASE 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: ./bin/clang -cc1 -include-pch /tmp/pch -std=c++2a
-emit-llvm -o - /tmp/t2.cpp 
1.      <eof> parser at end of file
 #0 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm-project/llvm/lib/Support/Unix/Signals.inc:564:13
 #1 llvm::sys::RunSignalHandlers()
llvm-project/llvm/lib/Support/Signals.cpp:69:18
 #2 SignalHandler(int) llvm-project/llvm/lib/Support/Unix/Signals.inc:396:3
 #3 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14110)
 #4 clang::ConceptReference::getNamedConcept() const
llvm-project/clang/include/clang/AST/ASTConcept.h:155:12
 #5 isSameTemplateParameter(clang::NamedDecl const*, clang::NamedDecl const*)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:2919:17
 #6 isSameTemplateParameterList(clang::ASTContext const&,
clang::TemplateParameterList const*, clang::TemplateParameterList const*)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:3010:10
 #7 clang::ASTDeclReader::findExisting(clang::NamedDecl*)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:3498:13
 #8 clang::ASTDeclReader::FindExistingResult::operator clang::NamedDecl*()
const llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:238:44
 #9 void
clang::ASTDeclReader::mergeRedeclarable<clang::RedeclarableTemplateDecl>(clang::Redeclarable<clang::RedeclarableTemplateDecl>*,
clang::ASTDeclReader::RedeclarableResult&, unsigned int)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:2505:31
#10
clang::ASTDeclReader::VisitRedeclarableTemplateDecl(clang::RedeclarableTemplateDecl*)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:2090:18
#11
clang::ASTDeclReader::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl*)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:2236:18
#12 clang::ASTDeclReader::Visit(clang::Decl*)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:527:34
#13 llvm::isa_impl<clang::DeclContext, clang::Decl, void>::doit(clang::Decl
const&) llvm-project/llvm/include/llvm/Support/Casting.h:58:12
#14 llvm::isa_impl_cl<clang::DeclContext, clang::Decl const*>::doit(clang::Decl
const*) llvm-project/llvm/include/llvm/Support/Casting.h:105:12
#15 llvm::isa_impl_wrap<clang::DeclContext, clang::Decl const*, clang::Decl
const*>::doit(clang::Decl const* const&)
llvm-project/llvm/include/llvm/Support/Casting.h:131:12
#16 llvm::isa_impl_wrap<clang::DeclContext, clang::Decl* const, clang::Decl
const*>::doit(clang::Decl* const&)
llvm-project/llvm/include/llvm/Support/Casting.h:121:12
#17 bool llvm::isa<clang::DeclContext, clang::Decl*>(clang::Decl* const&)
llvm-project/llvm/include/llvm/Support/Casting.h:142:10
#18 llvm::cast_retty<clang::DeclContext, clang::Decl*>::ret_type
llvm::dyn_cast<clang::DeclContext, clang::Decl>(clang::Decl*)
llvm-project/llvm/include/llvm/Support/Casting.h:345:10
#19 clang::ASTReader::ReadDeclRecord(unsigned int)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:4061:18
#20 clang::ASTReader::GetDecl(unsigned int)
llvm-project/clang/lib/Serialization/ASTReader.cpp:7424:9
#21 clang::ASTReader::FindExternalVisibleDeclsByName(clang::DeclContext const*,
clang::DeclarationName)
llvm-project/clang/lib/Serialization/ASTReader.cpp:7614:37
#22 clang::DeclContext::lookup(clang::DeclarationName) const
llvm-project/clang/lib/AST/DeclBase.cpp:1699:60
#23 clang::ASTReader::CompleteRedeclChain(clang::Decl const*)
llvm-project/clang/lib/Serialization/ASTReader.cpp:7191:62
#24 clang::LazyGenerationalUpdatePtr<clang::Decl const*, clang::Decl*,
&(clang::ExternalASTSource::CompleteRedeclChain(clang::Decl
const*))>::get(clang::Decl const*)
llvm-project/clang/include/clang/AST/ExternalASTSource.h:449:23
#25
clang::Redeclarable<clang::FunctionDecl>::DeclLink::getPrevious(clang::FunctionDecl
const*) const llvm-project/clang/include/clang/AST/Redeclarable.h:134:62
#26 clang::Redeclarable<clang::FunctionDecl>::getNextRedeclaration() const
llvm-project/clang/include/clang/AST/Redeclarable.h:190:23
#27 clang::Redeclarable<clang::FunctionDecl>::redecl_iterator::operator++()
llvm-project/clang/include/clang/AST/Redeclarable.h:271:34
#28 clang::FunctionDecl::isDefined(clang::FunctionDecl const*&) const
llvm-project/clang/lib/AST/Decl.cpp:2871:15
#29 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool, bool)
llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:4615:58
#30 clang::FunctionDecl::isDefined() const
llvm-project/clang/include/clang/AST/Decl.h:2035:12
#31 clang::Sema::PerformPendingInstantiations(bool)
llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:6074:23
#32 llvm::TimeTraceScope::~TimeTraceScope()
llvm-project/llvm/include/llvm/Support/TimeProfiler.h:86:9
#33 clang::Sema::ActOnEndOfTranslationUnitFragment(clang::Sema::TUFragmentKind)
llvm-project/clang/lib/Sema/Sema.cpp:957:3
#34 clang::Sema::ActOnEndOfTranslationUnit()
llvm-project/clang/lib/Sema/Sema.cpp:998:9
#35 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&,
bool) llvm-project/clang/lib/Parse/Parser.cpp:657:15
#36
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
llvm-project/clang/lib/Parse/Parser.cpp:555:26
#37 clang::ParseAST(clang::Sema&, bool, bool)
llvm-project/clang/lib/Parse/ParseAST.cpp:0:25
#38 clang::FrontendAction::Execute()
llvm-project/clang/lib/Frontend/FrontendAction.cpp:954:10
#else
#endif</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>