<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 - PCH deserialization crash on c++17 CXXDeductionGuideDecl."
href="https://bugs.llvm.org/show_bug.cgi?id=47219">47219</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>PCH deserialization crash on c++17 CXXDeductionGuideDecl.
</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>-New Bugs
</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>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>$ cat /tmp/pch.cc
#ifndef HEADER
#define HEADER
typedef int MyInt;
template <typename T>
class Some {
public:
explicit Some(T, MyInt) {}
};
// Class template argument deduction
template <typename T>
Some(T) -> Some<T>;
struct Foo {};
void ParseNatural() {
Some(Foo(), 1);
}
#else
#endif
$ ./bin/clang -cc1 -emit-pch -std=c++17 -o /tmp/test.pch /tmp/pch.cc
<<<
$ ./bin/clang -cc1 -include-pch /tmp/test.pch -emit-llvm -std=c++17 -o -
/tmp/pch.cc
<<<
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: ./bin/clang -cc1 -include-pch /tmp/test.pch
-emit-llvm -std=c++17 -o - /tmp/pch.cc
1. <eof> parser at end of file
#0 0x00000000026b344f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm-project/llvm/lib/Support/Unix/Signals.inc:563:13
#1 0x00000000026b1620 llvm::sys::RunSignalHandlers()
llvm-project/llvm/lib/Support/Signals.cpp:69:18
#2 0x00000000026b38c5 SignalHandler(int)
llvm-project/llvm/lib/Support/Unix/Signals.inc:395:3
#3 0x00007fee5383e110 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14110)
#4 0x0000000004bb871f clang::TypedefNameDecl::getUnderlyingType() const
llvm-project/clang/include/clang/AST/Decl.h:0:0
#5 0x0000000004bb871f clang::TypedefType::TypedefType(clang::Type::TypeClass,
clang::TypedefNameDecl const*, clang::QualType)
llvm-project/clang/lib/AST/Type.cpp:3347:24
#6 0x0000000004828b4d clang::ASTContext::getTypedefType(clang::TypedefNameDecl
const*, clang::QualType) const
llvm-project/clang/lib/AST/ASTContext.cpp:4365:21
#7 0x0000000002eecdcf clang::ASTReader::readTypeRecord(unsigned int)
llvm-project/clang/lib/Serialization/ASTReader.cpp:0:0
#8 0x0000000002ee157e std::vector<clang::QualType,
std::allocator<clang::QualType> >::operator[](unsigned long)
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_vector.h:1043:25
#9 0x0000000002ee157e clang::ASTReader::GetType(unsigned int)
llvm-project/clang/lib/Serialization/ASTReader.cpp:7054:5
#10 0x0000000002f27e85
clang::ASTReader::readType(clang::serialization::ModuleFile&,
llvm::SmallVector<unsigned long, 64u> const&, unsigned int&)
llvm-project/clang/include/clang/Serialization/ASTReader.h:1800:12
#11 0x0000000002f27e85 clang::ASTRecordReader::readType()
llvm-project/clang/include/clang/Serialization/ASTRecordReader.h:177:20
#12 0x0000000002f27e85 clang::ASTRecordReader::readQualType()
llvm-project/clang/include/clang/Serialization/ASTRecordReader.h:180:12
#13 0x0000000002f27e85 clang::QualType
clang::serialization::ReadDispatcher<clang::QualType>::read<clang::ASTRecordReader>(clang::ASTRecordReader&)
llvm-project/build/tools/clang/include/clang/AST/AbstractBasicReader.inc:204:14
#14 0x0000000002f27e85 llvm::ArrayRef<clang::QualType>
clang::serialization::DataStreamBasicReader<clang::ASTRecordReader>::readArray<clang::QualType>(llvm::SmallVectorImpl<clang::QualType>&)
llvm-project/clang/include/clang/AST/AbstractBasicReader.h:154:24
#15 0x0000000002f26a42
clang::serialization::AbstractTypeReader<clang::ASTRecordReader>::readFunctionProtoType()
llvm-project/build/tools/clang/include/clang/AST/AbstractTypeReader.inc:0:73
#16 0x0000000002eecdcf clang::ASTReader::readTypeRecord(unsigned int)
llvm-project/clang/lib/Serialization/ASTReader.cpp:0:0
#17 0x0000000002ee157e std::vector<clang::QualType,
std::allocator<clang::QualType> >::operator[](unsigned long)
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_vector.h:1043:25
#18 0x0000000002ee157e clang::ASTReader::GetType(unsigned int)
llvm-project/clang/lib/Serialization/ASTReader.cpp:7054:5
#19 0x0000000002f37485 llvm::PointerUnion<clang::Type const*, clang::ExtQuals
const*>::isNull() const
llvm-project/llvm/include/llvm/ADT/PointerUnion.h:172:33
#20 0x0000000002f37485 clang::QualType::isNull() const
llvm-project/clang/include/clang/AST/Type.h:726:31
#21 0x0000000002f37485
clang::ASTDeclReader::VisitDeclaratorDecl(clang::DeclaratorDecl*)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:835:15
#22 0x0000000002f3758f llvm::PointerIntPair<void*, 1u, int,
llvm::pointer_union_detail::PointerUnionUIntTraits<clang::TypeSourceInfo*,
clang::DeclaratorDecl::ExtInfo*>, llvm::PointerIntPairInfo<void*, 1u,
llvm::pointer_union_detail::PointerUnionUIntTraits<clang::TypeSourceInfo*,
clang::DeclaratorDecl::ExtInfo*> > >::getInt() const
llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:61:57
#23 0x0000000002f3758f bool llvm::PointerUnion<clang::TypeSourceInfo*,
clang::DeclaratorDecl::ExtInfo*>::is<clang::DeclaratorDecl::ExtInfo*>() const
llvm-project/llvm/include/llvm/ADT/PointerUnion.h:181:22
#24 0x0000000002f3758f clang::DeclaratorDecl::hasExtInfo() const
llvm-project/clang/include/clang/AST/Decl.h:701:45
#25 0x0000000002f3758f clang::DeclaratorDecl::getTypeSourceInfo() const
llvm-project/clang/include/clang/AST/Decl.h:716:12
#26 0x0000000002f3758f
clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:845:11
#27 0x0000000002f34940
clang::ASTDeclReader::VisitCXXDeductionGuideDecl(clang::CXXDeductionGuideDecl*)
llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp:1937:34</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>