Fix order of evaluation bug in DynTypedMatcher::constructVariadic().
If it evaluates right-to-left, the vector gets moved before we read the
kind from it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219624
91177308-0d34-0410-b5e6-
96231b3b80d8
// The different operators might deal differently with a mismatch.
// Make it the same as SupportedKind, since that is the broadest type we are
// allowed to accept.
- return DynTypedMatcher(InnerMatchers[0].SupportedKind,
- InnerMatchers[0].SupportedKind,
+ auto SupportedKind = InnerMatchers[0].SupportedKind;
+ return DynTypedMatcher(SupportedKind, SupportedKind,
new VariadicMatcher(Func, std::move(InnerMatchers)));
}