Skip to content

Commit 5f3a6af

Browse files
committed
Explicitly Specify a 64bit Shift to Fix Warning
Explicitly doing a 64bit shift silences the otherwise noisy warning: ``` [1548/1735] Building CXX object tools\swift\lib\Sema\CMakeFiles\swiftSema.dir\NameBinding.cpp.obj S:\toolchain\swift\include\swift/AST/IndexSubset.h(96): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) S:\toolchain\swift\include\swift/AST/IndexSubset.h(184): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) ```
1 parent 0a3a130 commit 5f3a6af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/AST/IndexSubset.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class IndexSubset : public llvm::FoldingSetNode {
9393
for (auto i : indices.set_bits()) {
9494
unsigned bitWordIndex, offset;
9595
std::tie(bitWordIndex, offset) = getBitWordIndexAndOffset(i);
96-
getBitWord(bitWordIndex) |= (1 << offset);
96+
getBitWord(bitWordIndex) |= (1ull << offset);
9797
}
9898
}
9999

@@ -181,7 +181,7 @@ class IndexSubset : public llvm::FoldingSetNode {
181181
bool contains(unsigned index) const {
182182
unsigned bitWordIndex, offset;
183183
std::tie(bitWordIndex, offset) = getBitWordIndexAndOffset(index);
184-
return getBitWord(bitWordIndex) & (1 << offset);
184+
return getBitWord(bitWordIndex) & (1ull << offset);
185185
}
186186

187187
bool isEmpty() const {

0 commit comments

Comments
 (0)