Commit 768133b3 authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r228464:

------------------------------------------------------------------------
r228464 | rsmith | 2015-02-06 15:20:21 -0800 (Fri, 06 Feb 2015) | 2 lines

PR22405: don't lose implicit-deleted-ness across AST write / read.

------------------------------------------------------------------------

llvm-svn: 228471
parent 0add565e
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -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);

@@ -1802,7 +1802,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
+18 −0
Original line number Diff line number Diff line
// 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>();
}