diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 799f6478a..279afd545 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -592,7 +592,7 @@ static inline const char *GetCstring(const String *str) { static inline flatbuffers::string_view GetStringView(const String *str) { return str ? str->string_view() : flatbuffers::string_view(); } -#endif // FLATBUFFERS_HAS_STRING_VIEW +#endif // FLATBUFFERS_HAS_STRING_VIEW // Allocator interface. This is flatbuffers-specific and meant only for // `vector_downward` usage. diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index cd81d822d..566482d21 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -1559,7 +1559,7 @@ CheckedError Parser::ParseMetaData(SymbolTable *attributes) { name); NEXT(); auto e = new Value(); - attributes->Add(name, e); + if (attributes->Add(name, e)) Warning("attribute already found: " + name); if (Is(':')) { NEXT(); ECHECK(ParseSingleValue(&name, *e, true));