mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 04:21:13 +00:00
[C++] support native_inline attribute for vector of tables (#7479)
This commit is contained in:
@@ -1153,8 +1153,12 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
|
||||
"definition");
|
||||
|
||||
field->native_inline = field->attributes.Lookup("native_inline") != nullptr;
|
||||
if (field->native_inline && !IsStruct(field->value.type))
|
||||
return Error("native_inline can only be defined on structs");
|
||||
if (field->native_inline && !IsStruct(field->value.type) &&
|
||||
!IsVectorOfStruct(field->value.type) &&
|
||||
!IsVectorOfTable(field->value.type))
|
||||
return Error(
|
||||
"'native_inline' can only be defined on structs, vector of structs or "
|
||||
"vector of tables");
|
||||
|
||||
auto nested = field->attributes.Lookup("nested_flatbuffer");
|
||||
if (nested) {
|
||||
|
||||
Reference in New Issue
Block a user