Removed internal variable with name "data" inside a generated method _nested_root(). Local variable with name "data" violates [-Werror=shadow]. (#4587)

This commit is contained in:
vglavnyy 2018-01-19 02:15:31 +07:00 committed by Wouter van Oortmerssen
parent fee9afd80b
commit e162366b3f
1 changed files with 1 additions and 2 deletions

View File

@ -1645,8 +1645,7 @@ class CppGenerator : public BaseGenerator {
code_.SetValue("CPP_NAME", TranslateNameSpace(qualified_name)); code_.SetValue("CPP_NAME", TranslateNameSpace(qualified_name));
code_ += " const {{CPP_NAME}} *{{FIELD_NAME}}_nested_root() const {"; code_ += " const {{CPP_NAME}} *{{FIELD_NAME}}_nested_root() const {";
code_ += " auto data = {{FIELD_NAME}}()->Data();"; code_ += " return flatbuffers::GetRoot<{{CPP_NAME}}>({{FIELD_NAME}}()->Data());";
code_ += " return flatbuffers::GetRoot<{{CPP_NAME}}>(data);";
code_ += " }"; code_ += " }";
} }