On Mon, Feb 16, 2015 at 3:08 AM, Benjamin Kramer <[email protected]> wrote:
> Author: d0k > Date: Mon Feb 16 05:08:00 2015 > New Revision: 229374 > > URL: http://llvm.org/viewvc/llvm-project?rev=229374&view=rev > Log: > ASTMatchers: Replace enable_if with static_assert. > > This is nicer in general and gives a better error message, but it also > might > bring MSVC 2013 back to life. > > Modified: > cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h > > Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h?rev=229374&r1=229373&r2=229374&view=diff > > ============================================================================== > --- cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h (original) > +++ cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h Mon Feb 16 > 05:08:00 2015 > @@ -1178,14 +1178,10 @@ template <unsigned MinCount, unsigned Ma > struct VariadicOperatorMatcherFunc { > DynTypedMatcher::VariadicOperator Op; > > - template <unsigned Count, typename T> > - struct EnableIfValidArity > - : public std::enable_if<MinCount <= Count && Count <= MaxCount, T> > {}; > - > template <typename... Ms> > - typename EnableIfValidArity<sizeof...(Ms), > - VariadicOperatorMatcher<Ms...>>::type > - operator()(Ms &&... Ps) const { > + VariadicOperatorMatcher<Ms...> operator()(Ms &&... Ps) const { > Why the space after the '...'? That seems to be in conflict with the usual LLVM style. > + static_assert(MinCount <= sizeof...(Ms) && sizeof...(Ms) <= MaxCount, > + "invalid number of parameters for variadic matcher"); > return VariadicOperatorMatcher<Ms...>(Op, std::forward<Ms>(Ps)...); > } > }; > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
