[flang-commits] [flang] 9df90de - [flang][MSVC] Work around what seems to be a bogus MSVC error
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Sun Oct 30 12:59:12 PDT 2022
Author: Peter Klausler
Date: 2022-10-30T12:59:01-07:00
New Revision: 9df90de317bfd6ac9e17c06f46fb4c9c834954d3
URL: https://github.com/llvm/llvm-project/commit/9df90de317bfd6ac9e17c06f46fb4c9c834954d3
DIFF: https://github.com/llvm/llvm-project/commit/9df90de317bfd6ac9e17c06f46fb4c9c834954d3.diff
LOG: [flang][MSVC] Work around what seems to be a bogus MSVC error
Recode a recent patch in an attempt to dodge a nonsensical error
from MSVC 14.
Added:
Modified:
flang/lib/Evaluate/fold-integer.cpp
Removed:
################################################################################
diff --git a/flang/lib/Evaluate/fold-integer.cpp b/flang/lib/Evaluate/fold-integer.cpp
index 1efb7415610e..f72a5a06ca1a 100644
--- a/flang/lib/Evaluate/fold-integer.cpp
+++ b/flang/lib/Evaluate/fold-integer.cpp
@@ -611,12 +611,15 @@ Expr<Type<TypeCategory::Integer, KIND>> FoldIntrinsicFunction(
} else {
return common::visit(
[&funcRef, &context, &FromInt64](const auto &str) -> Expr<T> {
- using Char = typename std::decay_t<decltype(str)>::Result;
- return FoldElementalIntrinsic<T, Char>(context,
+ using CharTy = typename std::decay_t<decltype(str)>::Result;
+ constexpr int charKind{CharTy::kind};
+ using MSVCWorkaround = Type<TypeCategory::Character, charKind>;
+ return FoldElementalIntrinsic<T, MSVCWorkaround>(context,
std::move(funcRef),
- ScalarFunc<T, Char>([&FromInt64](const Scalar<Char> &c) {
- return FromInt64(CharacterUtils<Char::kind>::ICHAR(c));
- }));
+ ScalarFunc<T, MSVCWorkaround>(
+ [&FromInt64](const Scalar<MSVCWorkaround> &c) {
+ return FromInt64(CharacterUtils<charKind>::ICHAR(c));
+ }));
},
someChar->u);
}
More information about the flang-commits
mailing list