forked from OSchip/llvm-project
Fix a bug in objc @encoding of C++ classes.
llvm-svn: 138235
This commit is contained in:
parent
8d382dc781
commit
c7e50c5cbd
|
@ -4565,7 +4565,9 @@ void ASTContext::getObjCEncodingForStructureImpl(RecordDecl *RDecl,
|
|||
std::multimap<uint64_t, NamedDecl *>::iterator
|
||||
CurLayObj = FieldOrBaseOffsets.begin();
|
||||
|
||||
if (CurLayObj != FieldOrBaseOffsets.end() && CurLayObj->first != 0) {
|
||||
if ((CurLayObj != FieldOrBaseOffsets.end() && CurLayObj->first != 0) ||
|
||||
(CurLayObj == FieldOrBaseOffsets.end() &&
|
||||
CXXRec && CXXRec->isDynamicClass())) {
|
||||
assert(CXXRec && CXXRec->isDynamicClass() &&
|
||||
"Offset 0 was empty but no VTable ?");
|
||||
if (FD) {
|
||||
|
|
|
@ -105,6 +105,27 @@ namespace rdar9624314 {
|
|||
const char g2[] = @encode(S2);
|
||||
}
|
||||
|
||||
namespace test {
|
||||
class Foo {
|
||||
public:
|
||||
virtual void f() {};
|
||||
};
|
||||
|
||||
class Bar {
|
||||
public:
|
||||
virtual void g() {};
|
||||
};
|
||||
|
||||
class Zoo : virtual public Foo, virtual public Bar {
|
||||
public:
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
// CHECK: @_ZN4testL3ecdE = internal constant [15 x i8] c"{Zoo=^^?ii^^?}\00"
|
||||
const char ecd[] = @encode(Zoo);
|
||||
}
|
||||
|
||||
struct Base1 {
|
||||
char x;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue