forked from OSchip/llvm-project
PR22405: don't lose implicit-deleted-ness across AST write / read.
llvm-svn: 228464
This commit is contained in:
parent
df956a2e78
commit
72625c2cad
|
@ -370,21 +370,21 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
|
|||
// FunctionDecl's body is handled last at ASTWriterDecl::Visit,
|
||||
// after everything else is written.
|
||||
|
||||
Record.push_back(D->getStorageClass()); // FIXME: stable encoding
|
||||
Record.push_back((int)D->SClass); // FIXME: stable encoding
|
||||
Record.push_back(D->IsInline);
|
||||
Record.push_back(D->isInlineSpecified());
|
||||
Record.push_back(D->isVirtualAsWritten());
|
||||
Record.push_back(D->isPure());
|
||||
Record.push_back(D->hasInheritedPrototype());
|
||||
Record.push_back(D->hasWrittenPrototype());
|
||||
Record.push_back(D->isDeletedAsWritten());
|
||||
Record.push_back(D->isTrivial());
|
||||
Record.push_back(D->isDefaulted());
|
||||
Record.push_back(D->isExplicitlyDefaulted());
|
||||
Record.push_back(D->hasImplicitReturnZero());
|
||||
Record.push_back(D->isConstexpr());
|
||||
Record.push_back(D->IsInlineSpecified);
|
||||
Record.push_back(D->IsVirtualAsWritten);
|
||||
Record.push_back(D->IsPure);
|
||||
Record.push_back(D->HasInheritedPrototype);
|
||||
Record.push_back(D->HasWrittenPrototype);
|
||||
Record.push_back(D->IsDeleted);
|
||||
Record.push_back(D->IsTrivial);
|
||||
Record.push_back(D->IsDefaulted);
|
||||
Record.push_back(D->IsExplicitlyDefaulted);
|
||||
Record.push_back(D->HasImplicitReturnZero);
|
||||
Record.push_back(D->IsConstexpr);
|
||||
Record.push_back(D->HasSkippedBody);
|
||||
Record.push_back(D->isLateTemplateParsed());
|
||||
Record.push_back(D->IsLateTemplateParsed);
|
||||
Record.push_back(D->getLinkageInternal());
|
||||
Writer.AddSourceLocation(D->getLocEnd(), Record);
|
||||
|
||||
|
@ -1819,7 +1819,7 @@ void ASTWriter::WriteDeclAbbrevs() {
|
|||
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Pure
|
||||
Abv->Add(BitCodeAbbrevOp(0)); // HasInheritedProto
|
||||
Abv->Add(BitCodeAbbrevOp(1)); // HasWrittenProto
|
||||
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // DeletedAsWritten
|
||||
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Deleted
|
||||
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Trivial
|
||||
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Defaulted
|
||||
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // ExplicitlyDefaulted
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// RUN: %clang_cc1 -std=c++11 -x c++-header %s -emit-pch -o %t.pch
|
||||
// RUN: %clang_cc1 -std=c++11 -x c++ /dev/null -include-pch %t.pch
|
||||
class move_only { move_only(const move_only&) = delete; move_only(move_only&&); };
|
||||
struct sb {
|
||||
move_only il;
|
||||
sb();
|
||||
sb(sb &&);
|
||||
};
|
||||
|
||||
template<typename T> T make();
|
||||
template<typename T> void doit(decltype(T(make<const T&>()))*) { T(make<const T&>()); }
|
||||
template<typename T> void doit(...) { T(make<T&&>()); }
|
||||
template<typename T> void later() { doit<T>(0); }
|
||||
|
||||
void fn1() {
|
||||
sb x;
|
||||
later<sb>();
|
||||
}
|
Loading…
Reference in New Issue