Index: tools/json_schema_compiler/cpp_type_generator.py |
diff --git a/tools/json_schema_compiler/cpp_type_generator.py b/tools/json_schema_compiler/cpp_type_generator.py |
index 95329c3f548614603df6fd0849879f852c57c086..b51edfb639047c48aa5eb6bfb18237e05f377585 100644 |
--- a/tools/json_schema_compiler/cpp_type_generator.py |
+++ b/tools/json_schema_compiler/cpp_type_generator.py |
@@ -222,7 +222,8 @@ class CppTypeGenerator(object): |
'name': type_name, |
'item_type': self.GetType(namespace.types[type_].item_type, |
wrap_optional=True)}) |
- else: |
+ # Enums cannot be forward declared. |
+ elif namespace.types[type_].type_ != PropertyType.ENUM: |
c.Append('struct %s;' % type_name) |
c.Append('}') |
c.Concat(self.GetNamespaceStart()) |