Skip to content

Commit f6aac0d

Browse files
committed
[flang] Fix DOT_PRODUCT for logical
A build-time check in a template class instantiation was applying a test that's meaningful only for numeric types. Differential Revision: https://reviews.llvm.org/D112345
1 parent fbb020f commit f6aac0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flang/runtime/dot-product.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ template <TypeCategory RCAT, int RKIND> struct DotProduct {
111111
if constexpr (constexpr auto resultType{
112112
GetResultType(XCAT, XKIND, YCAT, YKIND)}) {
113113
if constexpr (resultType->first == RCAT &&
114-
resultType->second <= RKIND) {
114+
(resultType->second <= RKIND || RCAT == TypeCategory::Logical)) {
115115
return DoDotProduct<RCAT, RKIND, CppTypeFor<XCAT, XKIND>,
116116
CppTypeFor<YCAT, YKIND>>(x, y, terminator);
117117
}

0 commit comments

Comments
 (0)