Skip to content

Commit 1572539

Browse files
authored
Rename variable empty to emptyString
Rename variable empty to emptyString in Value constructor to avoid shadowing of Value::empty(). GCC 4.8 produces the warning about this: lib_json/json_value.cpp: In constructor ‘Json::Value::Value(Json::ValueType)’: lib_json/json_value.cpp:346:27: warning: declaration of ‘empty’ shadows a member of 'this' [-Wshadow]
1 parent d8cd848 commit 1572539

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib_json/json_value.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ bool Value::CZString::isStaticString() const { return storage_.policy_ == noDupl
343343
* This optimization is used in ValueInternalMap fast allocator.
344344
*/
345345
Value::Value(ValueType vtype) {
346-
static char const empty[] = "";
346+
static char const emptyString[] = "";
347347
initBasic(vtype);
348348
switch (vtype) {
349349
case nullValue:
@@ -357,7 +357,7 @@ Value::Value(ValueType vtype) {
357357
break;
358358
case stringValue:
359359
// allocated_ == false, so this is safe.
360-
value_.string_ = const_cast<char*>(static_cast<char const*>(empty));
360+
value_.string_ = const_cast<char*>(static_cast<char const*>(emptyString));
361361
break;
362362
case arrayValue:
363363
case objectValue:

0 commit comments

Comments
 (0)