Allow tables that are entirely composed of native inlines to be copied. (#4958)
authorTaj Morton <tajmorton@gmail.com>
Mon, 1 Oct 2018 23:27:54 +0000 (16:27 -0700)
committerWouter van Oortmerssen <aardappel@gmail.com>
Mon, 1 Oct 2018 23:27:54 +0000 (16:27 -0700)
src/idl_gen_cpp.cpp

index 03778c5..a0abfdd 100644 (file)
@@ -1299,7 +1299,8 @@ class CppGenerator : public BaseGenerator {
           for (auto fit = ev.union_type.struct_def->fields.vec.begin();
                fit != ev.union_type.struct_def->fields.vec.end(); ++fit) {
             const auto &field = **fit;
-            if (!field.deprecated && field.value.type.struct_def) {
+            if (!field.deprecated && field.value.type.struct_def &&
+                !field.native_inline) {
               copyable = false;
               break;
             }