projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
64fe841
)
Make llvm::function_ref's operator bool explicit
author
David Blaikie
<dblaikie@gmail.com>
Thu, 26 Mar 2020 20:47:34 +0000
(13:47 -0700)
committer
David Blaikie
<dblaikie@gmail.com>
Fri, 27 Mar 2020 03:09:57 +0000
(20:09 -0700)
This can avoid all sorts of mistakes with implicit conversion
(indirectly) to int, etc. I'm quite surprise there aren't any things to
fixup with this - but I guess most uses of function_ref aren't
optional/nullable.
llvm/include/llvm/ADT/STLExtras.h
patch
|
blob
|
history
diff --git
a/llvm/include/llvm/ADT/STLExtras.h
b/llvm/include/llvm/ADT/STLExtras.h
index
638895e
..
ad1150b
100644
(file)
--- a/
llvm/include/llvm/ADT/STLExtras.h
+++ b/
llvm/include/llvm/ADT/STLExtras.h
@@
-124,7
+124,7
@@
public:
return callback(callable, std::forward<Params>(params)...);
}
- operator bool() const { return callback; }
+
explicit
operator bool() const { return callback; }
};
// deleter - Very very very simple method that is used to invoke operator