Skip to content

Commit

Permalink
[Clang] NFC Silence compiler warning spam (#86532)
Browse files Browse the repository at this point in the history
This non-functional change eliminates the compiler warning
```
/repo/llvm-project/clang/include/clang/Basic/SyncScope.h: In member function ‘virtual bool clang::AtomicScopeGenericModel::isValid(unsigned int) const’:
/repo/llvm-project/clang/include/clang/Basic/SyncScope.h:255:14: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     return S >= static_cast<unsigned>(System) &&
            ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
which was appearing repeatedly, as this header is included into very
many source files (through various chains of 6-7 header files).
  • Loading branch information
NagyDonat committed Mar 26, 2024
1 parent 3f8431e commit 4fa736b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions clang/include/clang/Basic/SyncScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ class AtomicScopeGenericModel : public AtomicScopeModel {
}

bool isValid(unsigned S) const override {
return S >= static_cast<unsigned>(System) &&
S <= static_cast<unsigned>(Last);
return S <= static_cast<unsigned>(Last);
}

ArrayRef<unsigned> getRuntimeValues() const override {
Expand Down

0 comments on commit 4fa736b

Please sign in to comment.