Add flatc '--cpp_std' switch (#5656)
authorVladimir Glavnyy <31897320+vglavnyy@users.noreply.github.com>
Mon, 23 Dec 2019 20:13:48 +0000 (03:13 +0700)
committerWouter van Oortmerssen <aardappel@gmail.com>
Mon, 23 Dec 2019 20:13:48 +0000 (12:13 -0800)
commit44bf719883248a392e04d9cebecdedb00cdd393c
tree6f62a383ee5612c3755811b62dd3270c3cb6e481
parent3e8f15df908c31b4c52308b621fed490cbac2ccc
Add flatc '--cpp_std' switch (#5656)

* Add flatc '--cpp_std' switch and sandbox for C++17 code generator

- Added 'flac --cpp_std legacy' for compatibility with old compilers (VS2010);
- Added experimental switch 'flac --cpp_std c++17' for future development;
- Added C++17 sandbox test_cpp17.cpp;
- C++ code generator generates enums with explicit underlying type to avoid problems with the forward and backward schema compatibility;
- Adjusted CMakeLists.txt, CI and generate code scripts to support of introduced '--cpp_std';

* Fix --cpp_std values: c++0x, c++11, c++17

* Add 'cpp::CppStandard' enum

* Add testing engine into test_cpp17

* Rebase to upstream/master

* Set default '--cpp-std C++0x'

* Fix code generation (--cpp_std C++11) in CMakeLists.txt

- Fix dependency declaration of grpctest target

* Revert --cpp-std for the tests from explicit C++11 to flatc default value (C++0x)
41 files changed:
.gitignore
CMakeLists.txt
appveyor.yml
docs/source/Compiler.md
grpc/build_grpc.sh
grpc/tests/message_builder_test.cpp
include/flatbuffers/flatbuffers.h
include/flatbuffers/flatc.h
include/flatbuffers/idl.h
include/flatbuffers/reflection_generated.h
reflection/generate_code.bat
reflection/generate_code.sh
samples/monster_generated.h
src/flatc.cpp
src/flatc_main.cpp
src/idl_gen_cpp.cpp
src/idl_parser.cpp
tests/arrays_test_generated.h
tests/cpp17/generated_cpp17/monster_test_generated.h [new file with mode: 0644]
tests/cpp17/test_cpp17.cpp [new file with mode: 0644]
tests/generate_code.bat
tests/generate_code.sh
tests/monster_test_generated.h
tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go
tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.py
tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go
tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.py
tests/namespace_test/NamespaceA/SecondTableInA.go
tests/namespace_test/NamespaceA/SecondTableInA.py
tests/namespace_test/NamespaceA/TableInFirstNS.go
tests/namespace_test/NamespaceA/TableInFirstNS.py
tests/namespace_test/NamespaceC/TableInC.go
tests/namespace_test/NamespaceC/TableInC.py
tests/namespace_test/namespace_test1_generated.h
tests/namespace_test/namespace_test2_generated.h
tests/namespace_test/namespace_test2_namespace_a_generated.dart
tests/namespace_test/namespace_test2_namespace_c_generated.dart
tests/test.cpp
tests/test_builder.cpp
tests/test_builder.h
tests/union_vector/union_vector_generated.h