YAML: Assign a value returned by the default constructor to the value in an optional...
authorAlex Lorenz <arphaman@gmail.com>
Wed, 17 Jun 2015 23:26:01 +0000 (23:26 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Wed, 17 Jun 2015 23:26:01 +0000 (23:26 +0000)
commit15db0fbcc8397960d8ed1e4a2421862875afb980
treedf71739dcedfb286ade9ad55a009ea82dc0e699c
parent6ebf741ea20beec72e6c898c99b601b8c64d370c
YAML: Assign a value returned by the default constructor to the value in an optional mapping.

This commit ensures that a value that's passed into YAML's IO mapOptional method
is going to be assigned a value returned by the default constructor for that
value's type when the appropriate key is not present in the YAML mapping.

Reviewers: Duncan P. N. Exon Smith

Differential Revision: http://reviews.llvm.org/D10492

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239972 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/YAMLTraits.h
unittests/Support/YAMLIOTest.cpp