Skip to content

Commit

Permalink
[flang] Correct TypeCode::IsLogical()
Browse files Browse the repository at this point in the history
F18 is using the type codes for C's "least" int types to encode
the various kinds of Fortran's LOGICAL intrinsic type; update
the IsLogical() predicate accordingly.  (This member function
isn't yet used anywhere, so this patch is nearly an NFC.)

Differential Revision: https://reviews.llvm.org/D100323
  • Loading branch information
klausler committed Apr 12, 2021
1 parent 52e9d80 commit 5fe83b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flang/runtime/type-code.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TypeCode {
}
constexpr bool IsLogical() const {
return raw_ == CFI_type_Bool ||
(raw_ >= CFI_type_int_fast8_t && raw_ <= CFI_type_int_fast64_t);
(raw_ >= CFI_type_int_least8_t && raw_ <= CFI_type_int_least64_t);
}
constexpr bool IsDerived() const { return raw_ == CFI_type_struct; }
constexpr bool IsIntrinsic() const { return IsValid() && !IsDerived(); }
Expand Down

0 comments on commit 5fe83b0

Please sign in to comment.