Commit Graph

5 Commits

Author SHA1 Message Date
Vladimir Glavnyy 04bec23a37
Add Array initialization from struct constructor (#5865) (#6147)
- add flatbuffers::span
- add new constructor for `struct` with `array`
- add some test for flatbuffers::span and 'arrays_test.fbs'
2020-10-12 12:24:18 -07:00
Derek Bailey 165a6e3d1e
Re-added Evolution Schema Code Generation Command (#5999)
* Fixed refractoring issue in reflection/generate_code.sh. Also, mv deletes the original file, so I don't need to clean it up manually in that case.

* Fixed Dart Tests by removing code-gen for included files.

* Added code gen for evolution tests back in.

* General generate code and clang format

* Added evolution schema generation to .bat file

* Added code gen for evolution tests back in.

* General generate code and clang format

* Added evolution schema generation to .bat file

* reran generate_code.sh

* Removed wildcard from generate_code.bat that doesn't work
2020-06-25 15:35:23 -07:00
Liu Liu cc44a44427
[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.
2020-06-15 23:18:12 -07:00
Arthur O'Dwyer 6b271b7ecb
Fix Clang-trunk warnings about special members deprecated in C++20. (#5829)
For example:

    include/flatbuffers/reflection.h:365:8: error: definition of implicit copy
          constructor for 'pointer_inside_vector<flatbuffers::Table, unsigned char>'
          is deprecated because it has a user-declared copy assignment operator
          [-Werror,-Wdeprecated-copy]
      void operator=(const pointer_inside_vector &piv);
           ^

It's unclear why the old code wanted to declare a public `operator=`
without defining it; that just seems like a misunderstanding of the C++03 idiom
for deleting a member function. And anyway, we don't *want* to delete the
assignment operator; these are polymorphic types that do not follow value
semantics and nobody should ever be trying to copy them. So the simplest fix
is just to go back to the Rule of Zero: remove the declaration of `operator=`
and let the compiler do what it wanted to do originally anyway.
"The best code is no code."

Also, update the generated .h files.

Fixes #5649.
2020-03-23 10:01:11 -07:00
Derek Bailey dda095023d [C++] Adds basic schema evolution tests (#5611)
* Added basic schema evolution tests

* Add BUILD targets for evolution tests. Added to test/generate_code scripts

* Use vector.front() instead of vector.data()

* Added --scoped-enums option for evolution test
2019-11-14 15:44:18 -08:00