зеркало из https://github.com/microsoft/clang-1.git
Implement PCH support for offsetof(base-specifier).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109785 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
90e99a84dd
Коммит
afbf3127cb
|
@ -502,11 +502,13 @@ void PCHStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
|
|||
E->setComponent(I, Node(Start, Reader.GetIdentifier(Record[Idx++]), End));
|
||||
break;
|
||||
|
||||
case Node::Base:
|
||||
// FIXME: Implement this!
|
||||
llvm_unreachable("PCH for offsetof(base-specifier) not implemented");
|
||||
case Node::Base: {
|
||||
CXXBaseSpecifier *Base = new (*Reader.getContext()) CXXBaseSpecifier();
|
||||
*Base = Reader.ReadCXXBaseSpecifier(DeclsCursor, Record, Idx);
|
||||
E->setComponent(I, Node(Base));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
|
||||
|
|
|
@ -483,8 +483,7 @@ void PCHStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
|
|||
break;
|
||||
|
||||
case OffsetOfExpr::OffsetOfNode::Base:
|
||||
// FIXME: Implement this!
|
||||
llvm_unreachable("PCH for offsetof(base-specifier) not implemented");
|
||||
Writer.AddCXXBaseSpecifier(*ON.getBase(), Record);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-offsetof-base.h
|
||||
// RUN: %clang_cc1 -include-pch %t -fsyntax-only %s
|
|
@ -0,0 +1,5 @@
|
|||
// Header for PCH test cxx-offsetof-base.cpp
|
||||
|
||||
struct Base { int x; };
|
||||
struct Derived : Base { int y; };
|
||||
int o = __builtin_offsetof(Derived, x);
|
Загрузка…
Ссылка в новой задаче