Commit 657a30ba authored by Ivan Murashov's avatar Ivan Murashov Committed by Chromium LUCI CQ

GCC: Do not change type in declaration from TimeDelta to auto

Using auto for a type in declaration of a constant previously declared
with a clearly specified type considered by GCC as a type mismatch.
An error example:
../../base/threading/hang_watcher.cc:44:39: error:
conflicting declaration 'constexpr const auto
base::HangWatchScopeEnabled::kDefaultHangWatchTime'
../../base/threading/hang_watcher.h:68:32: note:
previous declaration as 'const base::TimeDelta
base::HangWatchScopeEnabled::kDefaultHangWatchTime'

Now the declaration of kDefaultHangWatchTime in the cc file matched
to the declaration in the header file.

Bug: 819294
Change-Id: I108a771f9c8023cb13470ba0a4eaf6207e32b522
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2565578Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarOliver Li <olivierli@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832484}
parent 889d229a
...@@ -41,7 +41,8 @@ constexpr base::FeatureParam<int> kUIThreadLogLevel{ ...@@ -41,7 +41,8 @@ constexpr base::FeatureParam<int> kUIThreadLogLevel{
constexpr base::FeatureParam<int> kThreadPoolLogLevel{ constexpr base::FeatureParam<int> kThreadPoolLogLevel{
&HangWatcher::kEnableHangWatcher, "threadpool_log_level", 0}; &HangWatcher::kEnableHangWatcher, "threadpool_log_level", 0};
constexpr auto HangWatchScopeEnabled::kDefaultHangWatchTime = // static
const base::TimeDelta HangWatchScopeEnabled::kDefaultHangWatchTime =
base::TimeDelta::FromSeconds(10); base::TimeDelta::FromSeconds(10);
namespace { namespace {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment