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:
parent
fee9afd80b
commit
e162366b3f
|
@ -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_ += " }";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue