diff options
author | Liu Liu <i@liuliu.me> | 2020-06-15 23:18:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 23:18:12 -0700 |
commit | cc44a4442716601600aa50fb8a42abd55294212c (patch) | |
tree | aa9e55da67f92bda3104d0d7026b3bf06f569b05 /src | |
parent | 9ab4a5c0e29e3b574c3b0f4f0fcc80ff1e698194 (diff) | |
download | flatbuffers-cc44a4442716601600aa50fb8a42abd55294212c.tar.gz flatbuffers-cc44a4442716601600aa50fb8a42abd55294212c.tar.bz2 flatbuffers-cc44a4442716601600aa50fb8a42abd55294212c.zip |
[idl_parser] Mark typefield as deprecated (#5958)
* Mark typefield as deprecated
* Add UnionDeprecation Test.
* Update to use evolution schema instead.
* Use --scoped-enums to compile.
Diffstat (limited to 'src')
-rw-r--r-- | src/idl_parser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index af74610c..611f28d9 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -878,6 +878,11 @@ CheckedError Parser::ParseField(StructDef &struct_def) { val->constant = NumToString(id - 1); typefield->attributes.Add("id", val); } + // if this field is a union that is deprecated, + // the automatically added type field should be deprecated as well + if (field->deprecated) { + typefield->deprecated = true; + } } EXPECT(';'); |