summaryrefslogtreecommitdiff
path: root/third_party/base
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-07 15:16:01 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-07 15:16:01 -0800
commit4e597c8fd5d604273266ea19a1074a2c870ba224 (patch)
tree6311f6884e5316cb0c481cc141a08f8984cbfa6e /third_party/base
parent0d830c1e0db684d17f9b3c534dec8cecb17b674d (diff)
downloadpdfium-4e597c8fd5d604273266ea19a1074a2c870ba224.tar.xz
Force compiler to deduce src type for checked_cast<dst, src>.
Otherwise, we might be silently doing an unsafe cast before applying the check if the actual argument doesn't match the exact src type. Review-Url: https://codereview.chromium.org/2484953003
Diffstat (limited to 'third_party/base')
-rw-r--r--third_party/base/stl_util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/third_party/base/stl_util.h b/third_party/base/stl_util.h
index 0bf442c316..795414b59f 100644
--- a/third_party/base/stl_util.h
+++ b/third_party/base/stl_util.h
@@ -41,7 +41,7 @@ class FakeUniquePtr : public std::unique_ptr<T> {
// size_t size() method return values will be checked.
template <typename ResultType, typename Collection>
ResultType CollectionSize(const Collection& collection) {
- return pdfium::base::checked_cast<ResultType, size_t>(collection.size());
+ return pdfium::base::checked_cast<ResultType>(collection.size());
}
// Track the addition of an object to a set, removing it automatically when