[llvm-bugs] [Bug 47219] New: PCH deserialization crash on c++17 CXXDeductionGuideDecl.
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Aug 18 06:33:56 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=47219
Bug ID: 47219
Summary: PCH deserialization crash on c++17
CXXDeductionGuideDecl.
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: hokein at google.com
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, richard-llvm at metafoo.co.uk
$ 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 https://bugs.llvm.org/ 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
--
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/20200818/a48b3f9e/attachment-0001.html>
More information about the llvm-bugs
mailing list