mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
Fix compiler warnings (-Wdangling-reference)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
This commit is contained in:
parent
96bff7a7ed
commit
9f97e4ae61
@ -274,8 +274,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
add_compiler_flags(4.8 "-Wno-suggest-attribute=format")
|
||||
|
||||
add_compiler_flags(9.1 "-Wno-pessimizing-move")
|
||||
|
||||
add_compiler_flags(13.0 "-Wno-dangling-reference")
|
||||
endif (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
|
||||
|
||||
|
@ -495,8 +495,7 @@ Void EnumInterpreterAsString<T, notnull>::fromInterpretation(const Void& interVa
|
||||
}
|
||||
|
||||
try {
|
||||
const auto &entry = EnumOW::getEntryByName(interValue.template cast<String>());
|
||||
return EnumOW(entry.value);
|
||||
return EnumOW(EnumOW::getEntryByName(interValue.template cast<String>()).value);
|
||||
} catch (const std::runtime_error&) { // TODO - add a specific error for this.
|
||||
error = EnumInterpreterError::ENTRY_NOT_FOUND;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user