forked from OSchip/llvm-project
Removed a hack that gives zero-length arrays a
single element. Also modified our struct test case to test this. llvm-svn: 160449
This commit is contained in:
parent
358a789744
commit
6b76bc76fa
|
@ -6162,9 +6162,6 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
|
|||
{
|
||||
std::vector<uint64_t> element_orders;
|
||||
ParseChildArrayInfo(sc, dwarf_cu, die, first_index, element_orders, byte_stride, bit_stride);
|
||||
// We have an array that claims to have no members, lets give it at least one member...
|
||||
if (element_orders.empty())
|
||||
element_orders.push_back (1);
|
||||
if (byte_stride == 0 && bit_stride == 0)
|
||||
byte_stride = element_type->GetByteSize();
|
||||
clang_type_t array_element_type = element_type->GetClangForwardType();
|
||||
|
|
|
@ -10,6 +10,7 @@ int main (int argc, char const *argv[])
|
|||
{
|
||||
struct point_tag {
|
||||
int x;
|
||||
char padding[0];
|
||||
int y;
|
||||
}; // Set break point at this line.
|
||||
|
||||
|
@ -17,7 +18,7 @@ int main (int argc, char const *argv[])
|
|||
struct point_tag bottom_left;
|
||||
struct point_tag top_right;
|
||||
};
|
||||
struct point_tag pt = { 2, 3 }; // This is the first executable statement.
|
||||
struct rect_tag rect = {{1,2}, {3,4}};
|
||||
struct point_tag pt = { 2, {}, 3 }; // This is the first executable statement.
|
||||
struct rect_tag rect = {{1, {}, 2}, {3, {}, 4}};
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue