Index: include/llvm/Support/YAMLTraits.h =================================================================== --- include/llvm/Support/YAMLTraits.h +++ include/llvm/Support/YAMLTraits.h @@ -658,7 +658,8 @@ typename std::enable_if::value, void>::type mapOptionalWithContext(const char *Key, T &Val, Context &Ctx) { // omit key/value instead of outputting empty sequence - if (this->canElideEmptySequence() && !(Val.begin() != Val.end())) + if (this->canElideEmptySequence() && + SequenceTraits::size(*this, Val) == 0) return; this->processKey(Key, Val, false, Ctx); }