[llvm-commits] [llvm] r173507 - /llvm/trunk/include/llvm/Support/MathExtras.h

Reid Kleckner reid at kleckner.net
Fri Jan 25 14:12:45 PST 2013


Author: rnk
Date: Fri Jan 25 16:12:45 2013
New Revision: 173507

URL: http://llvm.org/viewvc/llvm-project?rev=173507&view=rev
Log:
Add parens to suppress an MSVC 2012 << precedence warning

It doesn't seem to like instantiating the isUInt<unsigned N> template
with 6+3, and then doing <<N.

Modified:
    llvm/trunk/include/llvm/Support/MathExtras.h

Modified: llvm/trunk/include/llvm/Support/MathExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MathExtras.h?rev=173507&r1=173506&r2=173507&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MathExtras.h (original)
+++ llvm/trunk/include/llvm/Support/MathExtras.h Fri Jan 25 16:12:45 2013
@@ -65,7 +65,7 @@
 /// isUInt - Checks if an unsigned integer fits into the given bit width.
 template<unsigned N>
 inline bool isUInt(uint64_t x) {
-  return N >= 64 || x < (UINT64_C(1)<<N);
+  return N >= 64 || x < (UINT64_C(1)<<(N));
 }
 // Template specializations to get better code for common cases.
 template<>





More information about the llvm-commits mailing list