Fixed generation of c++ code with flags (#6637)

* Fixed generation of c++ code with flags

* tweaking const

* moved to CONSTEXPR_CP11
This commit is contained in:
Derek Bailey
2021-05-15 13:27:24 -07:00
committed by GitHub
parent ef0eb3701d
commit 4867c94564
5 changed files with 19 additions and 19 deletions

View File

@@ -1620,7 +1620,7 @@ class CppGenerator : public BaseGenerator {
if (!opts_.generate_name_strings) { return; }
auto fullname = struct_def.defined_namespace->GetFullyQualifiedName(name);
code_.SetValue("NAME", fullname);
code_.SetValue("CONSTEXPR", "FLATBUFFERS_CONSTEXPR");
code_.SetValue("CONSTEXPR", "FLATBUFFERS_CONSTEXPR_CPP11");
code_ += " static {{CONSTEXPR}} const char *GetFullyQualifiedName() {";
code_ += " return \"{{NAME}}\";";
code_ += " }";