Segfault: one move to much
the temporary was destroyed before moving it out.
This commit is contained in:
parent
bb92b49340
commit
a05c9f81a6
3 changed files with 7 additions and 7 deletions
|
|
@ -353,17 +353,17 @@ namespace diff{
|
|||
/* === Specialisation to add fluent GenNode builder API to Record<GenNode> === */
|
||||
|
||||
template<>
|
||||
inline GenNode&&
|
||||
inline GenNode
|
||||
MakeRec::genNode()
|
||||
{
|
||||
return std::move (GenNode(std::move(record_)));
|
||||
return GenNode(std::move(record_));
|
||||
}
|
||||
|
||||
template<>
|
||||
inline GenNode&&
|
||||
inline GenNode
|
||||
MakeRec::genNode(string const& symbolicID)
|
||||
{
|
||||
return std::move (GenNode(symbolicID, std::move(record_)));
|
||||
return GenNode(symbolicID, std::move(record_));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -458,8 +458,8 @@ namespace diff{
|
|||
* with GenNode holding a Record<GenNode>
|
||||
*/
|
||||
|
||||
VAL&& genNode();
|
||||
VAL&& genNode(string const& symbolicID);
|
||||
VAL genNode();
|
||||
VAL genNode(string const& symbolicID);
|
||||
|
||||
template<typename X, typename...ARGS>
|
||||
Mutator& attrib (string const& key, X&& initialiser, ARGS&& ...args)
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ namespace test{
|
|||
CHECK (isnil(o1.data.get<Rec>()));
|
||||
|
||||
CHECK (!o2.isNamed());
|
||||
CHECK ("spam" == o0.data.get<Rec>().getType());
|
||||
CHECK ("spam" == o2.data.get<Rec>().getType());
|
||||
CHECK (isnil(o2.data.get<Rec>()));
|
||||
|
||||
CHECK (o3.isNamed());
|
||||
|
|
|
|||
Loading…
Reference in a new issue