Fix order of evaluation bug in DynTypedMatcher::constructVariadic().

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.

llvm-svn: 219624
This commit is contained in:
Samuel Benzaquen 2014-10-13 18:17:11 +00:00
parent 17a0011082
commit 193d87fd8c
1 changed files with 2 additions and 2 deletions

View File

@ -99,8 +99,8 @@ DynTypedMatcher DynTypedMatcher::constructVariadic(
// 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)));
}