Finish implementing (de-)serialization of the CXXDefinitionData bits

needed for implicit move constructors and move assignment
operators. Fixes PR10847.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139144 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Douglas Gregor 2011-09-06 16:38:46 +00:00
Родитель b2b5658a8e
Коммит 58e9797d00
3 изменённых файлов: 31 добавлений и 0 удалений

Просмотреть файл

@ -859,7 +859,9 @@ void ASTDeclReader::ReadCXXDefinitionData(
const RecordData &Record, unsigned &Idx) {
Data.UserDeclaredConstructor = Record[Idx++];
Data.UserDeclaredCopyConstructor = Record[Idx++];
Data.UserDeclaredMoveConstructor = Record[Idx++];
Data.UserDeclaredCopyAssignment = Record[Idx++];
Data.UserDeclaredMoveAssignment = Record[Idx++];
Data.UserDeclaredDestructor = Record[Idx++];
Data.Aggregate = Record[Idx++];
Data.PlainOldData = Record[Idx++];
@ -884,7 +886,9 @@ void ASTDeclReader::ReadCXXDefinitionData(
Data.UserProvidedDefaultConstructor = Record[Idx++];
Data.DeclaredDefaultConstructor = Record[Idx++];
Data.DeclaredCopyConstructor = Record[Idx++];
Data.DeclaredMoveConstructor = Record[Idx++];
Data.DeclaredCopyAssignment = Record[Idx++];
Data.DeclaredMoveAssignment = Record[Idx++];
Data.DeclaredDestructor = Record[Idx++];
Data.FailedImplicitMoveConstructor = Record[Idx++];
Data.FailedImplicitMoveAssignment = Record[Idx++];

Просмотреть файл

@ -3878,7 +3878,9 @@ void ASTWriter::AddCXXDefinitionData(const CXXRecordDecl *D, RecordDataImpl &Rec
struct CXXRecordDecl::DefinitionData &Data = *D->DefinitionData;
Record.push_back(Data.UserDeclaredConstructor);
Record.push_back(Data.UserDeclaredCopyConstructor);
Record.push_back(Data.UserDeclaredMoveConstructor);
Record.push_back(Data.UserDeclaredCopyAssignment);
Record.push_back(Data.UserDeclaredMoveAssignment);
Record.push_back(Data.UserDeclaredDestructor);
Record.push_back(Data.Aggregate);
Record.push_back(Data.PlainOldData);
@ -3903,7 +3905,9 @@ void ASTWriter::AddCXXDefinitionData(const CXXRecordDecl *D, RecordDataImpl &Rec
Record.push_back(Data.UserProvidedDefaultConstructor);
Record.push_back(Data.DeclaredDefaultConstructor);
Record.push_back(Data.DeclaredCopyConstructor);
Record.push_back(Data.DeclaredMoveConstructor);
Record.push_back(Data.DeclaredCopyAssignment);
Record.push_back(Data.DeclaredMoveAssignment);
Record.push_back(Data.DeclaredDestructor);
Record.push_back(Data.FailedImplicitMoveConstructor);
Record.push_back(Data.FailedImplicitMoveAssignment);

Просмотреть файл

@ -0,0 +1,23 @@
// Test with PCH
// RUN: %clang_cc1 -std=c++0x -x c++-header -emit-pch -o %t %s
// RUN: %clang_cc1 -std=c++0x -include-pch %t -verify %s
// PR10847
#ifndef HEADER
#define HEADER
struct NSSize {
double width;
double height;
};
typedef struct NSSize NSSize;
static inline NSSize NSMakeSize(double w, double h) {
NSSize s = { w, h };
return s;
}
#else
float test(float v1, float v2) {
NSSize s = NSMakeSize(v1, v2);
return s.width;
}
#endif