[llvm] 66b8308 - Add explicit cast to fix MSVC error: "'return': cannot convert from 'int (__cdecl *)(int)' to '`anonymous-namespace'::Plus1FunctionRef::FuncT'"
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 31 05:01:35 PDT 2022
Author: Simon Pilgrim
Date: 2022-10-31T12:01:06Z
New Revision: 66b830889d9bc4bfc58aa1ea47d1b3a7cbee7c5c
URL: https://github.com/llvm/llvm-project/commit/66b830889d9bc4bfc58aa1ea47d1b3a7cbee7c5c
DIFF: https://github.com/llvm/llvm-project/commit/66b830889d9bc4bfc58aa1ea47d1b3a7cbee7c5c.diff
LOG: Add explicit cast to fix MSVC error: "'return': cannot convert from 'int (__cdecl *)(int)' to '`anonymous-namespace'::Plus1FunctionRef::FuncT'"
Added:
Modified:
llvm/unittests/ADT/MappedIteratorTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/ADT/MappedIteratorTest.cpp b/llvm/unittests/ADT/MappedIteratorTest.cpp
index ca54cb30f9560..f2858bd11eceb 100644
--- a/llvm/unittests/ADT/MappedIteratorTest.cpp
+++ b/llvm/unittests/ADT/MappedIteratorTest.cpp
@@ -34,7 +34,7 @@ struct Plus1FunctionRef {
using FuncT = int (&)(int);
- FuncT operator()() const { return *plus1; }
+ FuncT operator()() const { return (FuncT)*plus1; }
};
struct Plus1FunctionPtr {
More information about the llvm-commits
mailing list