New issue
Advanced search Search tips

Issue 895475 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 23
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 894363



Sign in to add a comment

clang tot builds failing with new -Wshadow warning

Project Member Reported by h...@chromium.org, Oct 15

Issue description

For example, from https://ci.chromium.org/buildbot/chromium.clang/ToTLinux/4111


FAILED: obj/content/browser/browser/touch_selection_controller_client_aura.o 
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/content/browser/browser/touch_selection_controller_client_aura.o.d -DENABLE_SCREEN_CAPTURE=1 -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"344513\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCOMPONENT_BUILD -DCR_LIBCXX_REVISION=332543 -DCR_LIBCXXABI_REVISION=331450 -DCR_SYSROOT_HASH=e7c53f04bd88d29d075bfd1f62b073aeb69cbe09 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DCONTENT_IMPLEMENTATION -DV8_USE_EXTERNAL_STARTUP_DATA -DATK_LIB_DIR=\"/usr/lib/x86_64-linux-gnu\" -DUSE_ATK_BRIDGE -DATSPI_MAJOR_VERSION=2 -DATSPI_MINOR_VERSION=29 -DATSPI_MICRO_VERSION=1 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -DWEBP_EXTERN=extern -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DVK_NO_PROTOTYPES -DTOOLKIT_VIEWS=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DPROTOBUF_USE_DLLS -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSKIA_DLL -DGR_GL_IGNORE_ES3_MSAA=0 -DSKCMS_API=__attribute__\(\(visibility\(\"default\"\)\)\) -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_NO_PROTOTYPES -DLEVELDB_PLATFORM_CHROMIUM=1 -DLEVELDB_PLATFORM_CHROMIUM=1 -DLEVELDB_SHARED_LIBRARY -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DBORINGSSL_SHARED_LIBRARY -DABSL_ALLOCATOR_NOTHROW=1 -DNO_MAIN_THREAD_WRAPPING -DUSING_V8_SHARED -DV8_DEPRECATION_WARNINGS -DAUDIO_PROCESSING_IN_AUDIO_SERVICE -DSQLITE_ENABLE_FTS3 -DSQLITE_DISABLE_FTS3_UNICODE -DSQLITE_DISABLE_FTS4_DEFERRED -DSQLITE_ENABLE_ICU -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_SECURE_DELETE -DSQLITE_SEPARATE_CACHE_POOLS -DSQLITE_THREADSAFE=1 -DSQLITE_MAX_WORKER_THREADS=0 -DSQLITE_MAX_MMAP_SIZE=268435456 -DSQLITE_MMAP_READ_ONLY=1 -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 -DSQLITE_DEFAULT_LOOKASIDE=0,0 -DSQLITE_DEFAULT_MEMSTATUS=1 -DSQLITE_DEFAULT_PAGE_SIZE=4096 -DSQLITE_DEFAULT_PCACHE_INITSZ=0 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_USE_ALLOCA -DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTORESET -DSQLITE_OMIT_COMPILEOPTION_DIAGS -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_TRACE -DSQLITE_HAVE_ISNAN -DSQLITE_ENABLE_LOCKING_STYLE=0 -DFLAC__NO_DLL -I../.. -Igen -I../../third_party/libwebp/src -I../../third_party/khronos -I../../gpu -I../../third_party/libyuv/include -I../../third_party/vulkan/include -I../../third_party/ced/src -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/protobuf/src -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/docs -I../../third_party/skia/include/effects -I../../third_party/skia/include/encode -I../../third_party/skia/include/gpu -I../../third_party/skia/include/pathops -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/vulkan/include -I../../third_party/skia/third_party/vulkanmemoryallocator -I../../third_party/skia/include/codec -I../../third_party/skia/src/gpu -I../../third_party/skia/src/sksl -I../../third_party/skia/modules/skottie/include -I../../third_party/vulkan/include -I../../third_party/libwebm/source -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/leveldatabase -I../../third_party/leveldatabase/src -I../../third_party/leveldatabase/src/include -I../../third_party/webrtc_overrides -I../../testing/gtest/include -I../../third_party/webrtc -I../../third_party/webrtc_overrides -I../../third_party/webrtc -Igen/third_party/metrics_proto -I../../third_party/boringssl/src/include -I../../third_party/mesa_headers -I../../third_party/abseil-cpp -I../../v8/include -Igen/v8/include -I../../third_party/perfetto/include -Igen/third_party/perfetto/protos -Igen/third_party/perfetto/protos -Igen/third_party/perfetto/protos -I../../third_party/angle/src/common/third_party/base -Igen/angle -I../../third_party/brotli/include -I../../third_party/re2/src -I../../third_party/zlib -I../../third_party/fontconfig/src -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -no-canonical-prefixes -fcomplete-member-pointers -m64 -march=x86-64 -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-user-defined-warnings -Wno-unused-lambda-capture -Wno-null-pointer-arithmetic -Wno-enum-compare-switch -Wno-ignored-pragma-optimize -Wno-defaulted-function-deleted -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g2 -ggnu-pubnames -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wshadow -Wexit-time-destructors -Wno-unused-function -Wno-unused-local-typedef -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/atk-1.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/at-spi2-atk/2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/at-spi-2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/dbus-1.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/dbus-1.0/include -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/at-spi-2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/dbus-1.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/dbus-1.0/include -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/pango-1.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/cairo -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/harfbuzz -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/fribidi -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/libpng16 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/uuid -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/pixman-1 -Wno-shorten-64-to-32 -Wno-header-guard -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/nss -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/nspr -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/dbus-1.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/dbus-1.0/include -std=c++14 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_sid_amd64-sysroot -fvisibility-inlines-hidden -c ../../content/browser/renderer_host/input/touch_selection_controller_client_aura.cc -o obj/content/browser/browser/touch_selection_controller_client_aura.o
In file included from ../../content/browser/renderer_host/input/touch_selection_controller_client_aura.cc:10:
In file included from ../../content/browser/renderer_host/render_widget_host_view_aura.h:40:
In file included from ../../ui/aura/window_delegate.h:11:
In file included from ../../ui/aura/window.h:28:
In file included from ../../ui/compositor/layer_animator.h:21:
../../ui/compositor/layer_animation_element.h:41:5: error: declaration shadows a variable in namespace 'ui' [-Werror,-Wshadow]
    UNKNOWN = 0,
    ^
../../ui/latency/latency_info.h:97:3: note: previous declaration is here
  UNKNOWN,
  ^
1 error generated.
 
This is the first build:
https://ci.chromium.org/buildbot/chromium.clang/ToTLinux/4038

So Clang revision range is 344248:344280
This sounds relevant:

------------------------------------------------------------------------
r344259 | aaronballman | 2018-10-11 18:40:18 +0200 (Thu, 11 Oct 2018) | 8 lines

Improve -Wshadow warnings with enumerators.

Addresses PR24718 by checking for enumerators that shadow other enumerators. Catches issues like:

enum E1{e1};
void f(void) {
  enum E2{e1};
}
------------------------------------------------------------------------
A linux debug build sees 13 instances:

../../media/cdm/api/content_decryption_module.h:670:28: warning: declaration shadows a variable in namespace 'cdm' [-Wshadow]
../../third_party/blink/public/web/web_settings.h:66:5: warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/public/web/web_settings.h:67:5: warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/public/web/web_settings.h:68:5: warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/public/web/web_settings.h:69:5: warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/public/web/web_settings.h:70:5: warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/renderer/core/html/forms/html_select_element.h:237:5: warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/renderer/platform/bindings/dom_wrapper_world.h:62:5: warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/renderer/platform/bindings/dom_wrapper_world.h:63:5: warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/renderer/platform/text/text_run.h:53:23: warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../ui/compositor/layer_animation_element.h:41:5: warning: declaration shadows a variable in namespace 'ui' [-Wshadow]
../../ui/gfx/canvas.h:72:5: warning: declaration shadows a variable in namespace 'gfx' [-Wshadow]
../../v8/include/v8-profiler.h:369:5: warning: declaration shadows a variable in namespace 'v8' [-Wshadow]
buildlog.txt.gz
604 KB Download
Owner: h...@chromium.org
Status: Started (was: Available)
Getting started:
WebSettings: https://chromium-review.googlesource.com/c/chromium/src/+/1282445
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c1a602ff51fee2ca710ed6f9f29a3869e8c1dfaa

commit c1a602ff51fee2ca710ed6f9f29a3869e8c1dfaa
Author: Hans Wennborg <hans@chromium.org>
Date: Tue Oct 16 14:35:26 2018

Make WebSettings::V8CacheOptions an enum class, fixing -Wshadow warnings

A new version of Clang made the -Wshadow warning also apply to
enumerators, warning that the blink::WebSettings::V8CacheOptions
enumerators shadow the enumerators from blink::V8CacheOptions, e.g.

49344/58815] CXX obj/third_party/blink/renderer/core/core_generated/v8_code_cache.o
In file included from
../../third_party/blink/renderer/bindings/core/v8/v8_code_cache.cc:9:
../../third_party/blink/public/web/web_settings.h:66:5: warning: declaration
shadows a variable in namespace 'blink' [-Wshadow]
    kV8CacheOptionsDefault,
    ^
../../third_party/blink/renderer/bindings/core/v8/v8_cache_options.h:37:3:
note: previous declaration is here
  kV8CacheOptionsDefault,  // Use whatever the current default is.
  ^

Bug:  895475 
Change-Id: I6de82855f3db4655c1bfaa4bb8d77fab1466188e
Reviewed-on: https://chromium-review.googlesource.com/c/1282445
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599974}
[modify] https://crrev.com/c1a602ff51fee2ca710ed6f9f29a3869e8c1dfaa/content/public/common/web_preferences.cc
[modify] https://crrev.com/c1a602ff51fee2ca710ed6f9f29a3869e8c1dfaa/content/shell/test_runner/test_runner.cc
[modify] https://crrev.com/c1a602ff51fee2ca710ed6f9f29a3869e8c1dfaa/third_party/blink/public/web/web_embedded_worker_start_data.h
[modify] https://crrev.com/c1a602ff51fee2ca710ed6f9f29a3869e8c1dfaa/third_party/blink/public/web/web_settings.h
[modify] https://crrev.com/c1a602ff51fee2ca710ed6f9f29a3869e8c1dfaa/third_party/blink/renderer/bindings/core/v8/v8_code_cache.cc
[modify] https://crrev.com/c1a602ff51fee2ca710ed6f9f29a3869e8c1dfaa/third_party/blink/renderer/modules/service_worker/web_embedded_worker_impl_test.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Oct 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/06f4e350b25684c88afe33461d06d1e931385a60

commit 06f4e350b25684c88afe33461d06d1e931385a60
Author: Hans Wennborg <hans@chromium.org>
Date: Tue Oct 16 18:55:43 2018

Fix -Wshadow warnings for HTMLSelectElement's SelectOptionFlag enum

Recent versions of Clang started taking enumerations into account for the -Wshadow warning, e.g.

../../third_party/blink/renderer/core/html/forms/html_select_element.h:237:5:
warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
    kDispatchInputAndChangeEvent = 1 << 1,
    ^
../../third_party/blink/renderer/core/html/forms/text_control_element.h:48:3:
note: previous declaration is here
  kDispatchInputAndChangeEvent
  ^

Fix this by adding a Flag suffix to the enumerations, which is good for clarity too.

Bug:  895475 
Change-Id: Ie9225dc711fc3985a46c2f56040bc56c8a451495
Reviewed-on: https://chromium-review.googlesource.com/c/1283749
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600060}
[modify] https://crrev.com/06f4e350b25684c88afe33461d06d1e931385a60/third_party/blink/renderer/core/html/forms/html_select_element.cc
[modify] https://crrev.com/06f4e350b25684c88afe33461d06d1e931385a60/third_party/blink/renderer/core/html/forms/html_select_element.h

Project Member

Comment 9 by bugdroid1@chromium.org, Oct 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/be8b4f925f440bed19bcbd5a741ef0c645f56802

commit be8b4f925f440bed19bcbd5a741ef0c645f56802
Author: Hans Wennborg <hans@chromium.org>
Date: Tue Oct 16 19:08:04 2018

Remove unused enum TextRun::TextCodePath

New Clang versions warn that kAuto shadows LengthType::kAuto. It's easy to fix
because the enum isn't used at all.

Bug:  895475 
Change-Id: I04c63a9ff87afdb08b060a987bc7a160fecc62e4
Reviewed-on: https://chromium-review.googlesource.com/c/1283691
Commit-Queue: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600065}
[modify] https://crrev.com/be8b4f925f440bed19bcbd5a741ef0c645f56802/third_party/blink/renderer/platform/text/text_run.h

Project Member

Comment 10 by bugdroid1@chromium.org, Oct 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c4ad2033a8388520a2bcabc9af9701de73584274

commit c4ad2033a8388520a2bcabc9af9701de73584274
Author: Hans Wennborg <hans@chromium.org>
Date: Tue Oct 16 21:57:13 2018

Fix -Wshadow warning for DOMWrapperWorld enumerations

New Clang versions started taking enumerations into account for the -Wshadow warning:

../../third_party/blink/renderer/platform/bindings/dom_wrapper_world.h:62:5:
warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
    kEmbedderWorldIdLimit = IsolatedWorldId::kEmbedderWorldIdLimit,
    ^
../../third_party/blink/public/platform/web_isolated_world_ids.h:12:3: note:
previous declaration is here
  kEmbedderWorldIdLimit = (1 << 29),
  ^

../../third_party/blink/renderer/platform/bindings/dom_wrapper_world.h:63:5:
warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
    kIsolatedWorldIdLimit = IsolatedWorldId::kIsolatedWorldIdLimit,
    ^
../../third_party/blink/public/platform/web_isolated_world_ids.h:16:3: note:
previous declaration is here
  kIsolatedWorldIdLimit,
  ^

Bug:  895475 
Change-Id: Idb37a14a6d7ca92b1e6bfa1d2fa3f42ffe64fe38
Reviewed-on: https://chromium-review.googlesource.com/c/1283024
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600141}
[modify] https://crrev.com/c4ad2033a8388520a2bcabc9af9701de73584274/third_party/blink/renderer/bindings/core/v8/dom_wrapper_world_test.cc
[modify] https://crrev.com/c4ad2033a8388520a2bcabc9af9701de73584274/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
[modify] https://crrev.com/c4ad2033a8388520a2bcabc9af9701de73584274/third_party/blink/renderer/platform/bindings/dom_wrapper_world.cc
[modify] https://crrev.com/c4ad2033a8388520a2bcabc9af9701de73584274/third_party/blink/renderer/platform/bindings/dom_wrapper_world.h

Project Member

Comment 12 by bugdroid1@chromium.org, Oct 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/71db598525df4a9ea6845fbe96cfdba7c2775896

commit 71db598525df4a9ea6845fbe96cfdba7c2775896
Author: Hans Wennborg <hans@chromium.org>
Date: Tue Oct 16 23:15:00 2018

Make ui::SourceEventType an enum class, fixing new -Wshadow warning

New Clang versions started taking enumerators into account for the
-Wshadow warning:

../../ui/compositor/layer_animation_element.h:41:5: warning: declaration
shadows a variable in namespace 'ui' [-Wshadow]
    UNKNOWN = 0,
    ^
../../ui/latency/latency_info.h:97:3: note: previous declaration is here
  UNKNOWN,
  ^

By making ui::SourceEventType an enum class, we avoid putting the enumerators
in such a large namespace as ui.

TBR=jochen

Bug:  895475 
Change-Id: I99347d754cb21dacb5d7c4bae975d3310dcb19fd
Reviewed-on: https://chromium-review.googlesource.com/c/1284951
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600177}
[modify] https://crrev.com/71db598525df4a9ea6845fbe96cfdba7c2775896/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
[modify] https://crrev.com/71db598525df4a9ea6845fbe96cfdba7c2775896/ui/latency/ipc/latency_info_param_traits_macros.h
[modify] https://crrev.com/71db598525df4a9ea6845fbe96cfdba7c2775896/ui/latency/latency_info.h
[modify] https://crrev.com/71db598525df4a9ea6845fbe96cfdba7c2775896/ui/latency/mojo/latency_info_struct_traits.cc
[modify] https://crrev.com/71db598525df4a9ea6845fbe96cfdba7c2775896/ui/latency/mojo/latency_info_struct_traits.h
[modify] https://crrev.com/71db598525df4a9ea6845fbe96cfdba7c2775896/ui/latency/mojo/struct_traits_unittest.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Oct 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fbc81f785e444ca7fefde6d5d7b38cc4a1b36a38

commit fbc81f785e444ca7fefde6d5d7b38cc4a1b36a38
Author: Hans Wennborg <hans@chromium.org>
Date: Wed Oct 17 00:51:17 2018

Fix -Wshadow warning for ui::Canvas::CHARACTER_BREAK

There is already the widely used ui::CharacterBreak. Fix by renaming the
Canvas one a little.

Bug:  895475 
Change-Id: I3e0e6854e58e1390cf90d25bffbc2bd851fb4f8f
Reviewed-on: https://chromium-review.googlesource.com/c/1284931
Commit-Queue: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600212}
[modify] https://crrev.com/fbc81f785e444ca7fefde6d5d7b38cc4a1b36a38/ui/gfx/canvas.h
[modify] https://crrev.com/fbc81f785e444ca7fefde6d5d7b38cc4a1b36a38/ui/gfx/canvas_skia.cc
[modify] https://crrev.com/fbc81f785e444ca7fefde6d5d7b38cc4a1b36a38/ui/message_center/views/bounded_label.cc
[modify] https://crrev.com/fbc81f785e444ca7fefde6d5d7b38cc4a1b36a38/ui/views/examples/text_example.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Oct 17

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/63ca293dcf23a997ebc7940ecf39af1df99c6a90

commit 63ca293dcf23a997ebc7940ecf39af1df99c6a90
Author: Hans Wennborg <hans@chromium.org>
Date: Wed Oct 17 14:51:20 2018

Remove PersistentContainerCallbackType::kWeak

From what I understand, it's been slated for removal for a long time, and
more accutely, Clang recently started warning about it being shadowed by
another kWeak enum:

../../v8/include/v8-profiler.h:369:5: warning: declaration shadows a variable
in namespace 'v8' [-Wshadow]
    kWeak = 6              // A weak reference (ignored by the GC).
    ^
../../v8/include/v8-util.h:29:3: note: previous declaration is here
  kWeak = kWeakWithParameter  // For backwards compatibility.  Deprecate.
  ^

Bug:  chromium:895475 
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I07de1418aea2d68ef5641ece4ab13f71b6d5ec7f
Reviewed-on: https://chromium-review.googlesource.com/c/1285189
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56743}
[modify] https://crrev.com/63ca293dcf23a997ebc7940ecf39af1df99c6a90/include/v8-util.h

Project Member

Comment 15 by bugdroid1@chromium.org, Oct 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/cdm/+/817c8005a57ea3ca417f767b3b3679601329afd8

commit 817c8005a57ea3ca417f767b3b3679601329afd8
Author: Hans Wennborg <hans@chromium.org>
Date: Wed Oct 17 16:43:33 2018

Make FileIOClient::Status an enum class, fixing -Wshadow warning

Recent Clang versions have started including enumerators in -Wshadow warnings:

[44590/58815] CXX obj/content/utility/utility/utility_service_factory.o
In file included from ../../content/utility/utility_service_factory.cc:39:
In file included from ../../media/mojo/services/mojo_cdm_helper.h:20:
In file included from ../../media/mojo/services/mojo_cdm_file_io.h:19:
../../media/cdm/api/content_decryption_module.h:670:28: warning: declaration
shadows a variable in namespace 'cdm' [-Wshadow]
  enum Status : uint32_t { kSuccess = 0, kInUse, kError };
                           ^
../../media/cdm/api/content_decryption_module.h:80:3: note: previous
declaration is here
  kSuccess = 0,
  ^

This patch fixes the warning by making FileIOClient::Status an enum class,
which means kSuccess needs to be referenced as Status::kSuccess. A few files in
Chromium needs an update when this rolls in.

Bug:  chromium:895475 
Change-Id: I8003c1494cb76b412b2990d4372e83442141c699
Reviewed-on: https://chromium-review.googlesource.com/c/1283076
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>

[modify] https://crrev.com/817c8005a57ea3ca417f767b3b3679601329afd8/content_decryption_module.h

Project Member

Comment 16 by bugdroid1@chromium.org, Oct 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/38f372a96805f47e956b85f418b3b42dd15f00bc

commit 38f372a96805f47e956b85f418b3b42dd15f00bc
Author: Hans Wennborg <hans@chromium.org>
Date: Wed Oct 17 18:23:23 2018

Roll media/cdm/api to pick up -Wshadow warning fix

And update references to FileIOClient::Status, because it's now an enum class.

Bug:  895475 
Change-Id: I1e0e9646416a969e87a9d34dd24b31dc0017889e
Reviewed-on: https://chromium-review.googlesource.com/c/1283370
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600484}
[modify] https://crrev.com/38f372a96805f47e956b85f418b3b42dd15f00bc/DEPS
[modify] https://crrev.com/38f372a96805f47e956b85f418b3b42dd15f00bc/media/cdm/library_cdm/clear_key_cdm/cdm_file_adapter.cc
[modify] https://crrev.com/38f372a96805f47e956b85f418b3b42dd15f00bc/media/cdm/library_cdm/clear_key_cdm/cdm_file_io_test.cc

I think we're just waiting for a V8 roll now.
The V8 roll landed: https://chromium-review.googlesource.com/c/chromium/src/+/1288711

I think this is the first clang tot build that picked it up: https://ci.chromium.org/buildbot/chromium.clang/ToTWin64(dbg)/1517
Looks like there were some more warnings on Windows.

$ grep Wshadow /tmp/build.log | sort -u 
../../third_party/blink/public/web/web_settings.h(53,5):  warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/public/web/web_settings.h(54,5):  warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/blink/public/web/web_settings.h(55,5):  warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
../../third_party/pdfium/core/fpdfapi/parser/cpdf_object.h(34,5):  warning: declaration shadows a typedef in the global namespace [-Wshadow]
../../third_party/pdfium/core/fpdfdoc/cpdf_aaction.h(21,5):  warning: declaration shadows a variable in the global namespace [-Wshadow]

Did I forget some in web_settings.h? 

In file included from ../../third_party/blink/renderer/bindings/core/v8/script_controller.cc:35:
../../third_party/blink/public/web/web_settings.h(53,5):  warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
    kImageAnimationPolicyAllowed,
    ^
/work/chromium/src/out/release/../../third_party/blink/renderer/platform/graphics/image_animation_policy.h(15,3):  note: previous declaration is here
  kImageAnimationPolicyAllowed,
  ^
In file included from ../../third_party/blink/renderer/bindings/core/v8/script_controller.cc:35:
../../third_party/blink/public/web/web_settings.h(54,5):  warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
    kImageAnimationPolicyAnimateOnce,
    ^
/work/chromium/src/out/release/../../third_party/blink/renderer/platform/graphics/image_animation_policy.h(17,3):  note: previous declaration is here
  kImageAnimationPolicyAnimateOnce,
  ^
In file included from ../../third_party/blink/renderer/bindings/core/v8/script_controller.cc:35:
../../third_party/blink/public/web/web_settings.h(55,5):  warning: declaration shadows a variable in namespace 'blink' [-Wshadow]
    kImageAnimationPolicyNoAnimation
    ^
/work/chromium/src/out/release/../../third_party/blink/renderer/platform/graphics/image_animation_policy.h(19,3):  note: previous declaration is here
  kImageAnimationPolicyNoAnimation
  ^
Note: including file: ../../third_party/blink/renderer/bindings/core/v8/referrer_script_info.h
3 warnings generated.


These are the pdfium ones:

[18867/23832] CXX obj/third_party/pdfium/pdfium/fpdf_catalog.obj
In file included from ../../third_party/pdfium/fpdfsdk/fpdf_catalog.cpp:7:
In file included from ../../third_party/pdfium/core/fpdfapi/parser/cpdf_dictionary.h:16:
../../third_party/pdfium/core/fpdfapi/parser/cpdf_object.h(34,5):  warning: declaration shadows a typedef in the global namespace [-Wshadow]
    BOOLEAN = 1,
    ^
../../third_party/depot_tools/win_toolchain/vs_files/3bc0ec615cf20ee342f3bc29bc991b5ad66d8d2c/win_sdk/Include/10.0.17134.0/um/winnt.h(1112,15):  note: previous declaration is here
typedef BYTE  BOOLEAN;           
              ^

[3584/56950] CXX obj/third_party/pdfium/fpdfsdk/pwl/pwl/cpwl_caret.obj
In file included from ../../third_party/pdfium/fpdfsdk/pwl/cpwl_caret.cpp:7:
In file included from ../../third_party/pdfium/fpdfsdk/pwl/cpwl_caret.h:10:
In file included from ../../third_party/pdfium/fpdfsdk/pwl/cpwl_wnd.h:12:
In file included from ../../third_party/pdfium/core/fpdfdoc/cpdf_formcontrol.h:10:
../../third_party/pdfium/core/fpdfdoc/cpdf_aaction.h(21,5):  warning: declaration shadows a variable in the global namespace [-Wshadow]
    GetFocus,
    ^
build.log.gz
613 KB Download
Project Member

Comment 22 by bugdroid1@chromium.org, Oct 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/66809e4938ef1e5aa9ba2ce5945d6ad721427d0a

commit 66809e4938ef1e5aa9ba2ce5945d6ad721427d0a
Author: Hans Wennborg <hans@chromium.org>
Date: Sat Oct 20 00:05:38 2018

Make WebSettings::ImageAnimationPolicy and EditingBehavior enum classes

This fixes Clang's newly enhanced -Wshadow warning which now covers enums (see
bug), and also makes the code nicer.

TBR=jochen

Bug:  895475 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: Ia8c8fff99b93efcd2c8278cd0b2ac739c4e0c917
Reviewed-on: https://chromium-review.googlesource.com/c/1289471
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601364}
[modify] https://crrev.com/66809e4938ef1e5aa9ba2ce5945d6ad721427d0a/content/public/common/web_preferences.cc
[modify] https://crrev.com/66809e4938ef1e5aa9ba2ce5945d6ad721427d0a/content/shell/test_runner/test_preferences.cc
[modify] https://crrev.com/66809e4938ef1e5aa9ba2ce5945d6ad721427d0a/third_party/blink/public/web/web_settings.h
[modify] https://crrev.com/66809e4938ef1e5aa9ba2ce5945d6ad721427d0a/third_party/blink/renderer/core/editing/editing_behavior.cc
[modify] https://crrev.com/66809e4938ef1e5aa9ba2ce5945d6ad721427d0a/third_party/blink/renderer/core/exported/web_frame_test.cc
[modify] https://crrev.com/66809e4938ef1e5aa9ba2ce5945d6ad721427d0a/third_party/blink/renderer/core/exported/web_settings_impl.cc

Project Member

Comment 23 by bugdroid1@chromium.org, Oct 22

The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/c320e9c7ad01ab48625e51fb3b6476d98b6167de

commit c320e9c7ad01ab48625e51fb3b6476d98b6167de
Author: Hans Wennborg <hans@chromium.org>
Date: Mon Oct 22 18:28:52 2018

Add k prefixes to CPDF_AAction::AActionType enumerators

The GetFocus enumerator was shadowing the GetFocus function in winuser.h.
Change the enumerators to all have a k prefix to avoid the warning, and since I
believe pdfium wants to move towards that style anyway.

Bug:  chromium:895475 
Change-Id: I740afa4f29d895e7e3cbb488fd311a7487d67a82
Reviewed-on: https://pdfium-review.googlesource.com/c/44470
Commit-Queue: Hans Wennborg <hans@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>

[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/fpdfsdk/cpdfsdk_widget.cpp
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/fpdfsdk/formfiller/cffl_textfield.cpp
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/fpdfsdk/cpdfsdk_baannot.cpp
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/fpdfsdk/cpdfsdk_actionhandler.cpp
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/core/fpdfdoc/cpdf_aaction.cpp
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/core/fpdfdoc/cpdf_aaction.h
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/fpdfsdk/formfiller/cffl_listbox.cpp
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/fpdfsdk/fpdf_formfill.cpp
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/fpdfsdk/cpdfsdk_interactiveform.cpp
[modify] https://crrev.com/c320e9c7ad01ab48625e51fb3b6476d98b6167de/fpdfsdk/formfiller/cffl_combobox.cpp

Project Member

Comment 24 by bugdroid1@chromium.org, Oct 22

The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/2f62d36bfac781428f3896b443177e033be4c554

commit 2f62d36bfac781428f3896b443177e033be4c554
Author: Hans Wennborg <hans@chromium.org>
Date: Mon Oct 22 19:17:02 2018

Rename CPDF_Object::Type enumerators with k prefixes

This was originally motivated by Clang's newly enhanced -Wshadow
warning, which complained about BOOLEAN shadowing a BOOLEAN typedef
in winnt.h. The warning has since been changed to not fire on enums
shadowing types, but it was suggested that this kind of naming change
was desirable anyway.

Bug:  chromium:895475 
Change-Id: I278ce9dbbd88f802fe5bc77fca28b082aa5e684d
Reviewed-on: https://pdfium-review.googlesource.com/c/44330
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>

[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_number.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/fpdfsdk/fpdf_ppo.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/page/cpdf_streamcontentparser.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_stream.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_name.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_null.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_data_avail.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfdoc/cpdf_formfield.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_array.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_string.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/fpdfsdk/fpdf_annot.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_object.h
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_reference.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_boolean.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_dictionary.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/cpdf_object_unittest.cpp
[modify] https://crrev.com/2f62d36bfac781428f3896b443177e033be4c554/core/fpdfapi/parser/fpdf_parser_utility.cpp

Project Member

Comment 25 by bugdroid1@chromium.org, Oct 22

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ada8c5c5553758c69e57b9b0b758124d2966b6ec

commit ada8c5c5553758c69e57b9b0b758124d2966b6ec
Author: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Date: Mon Oct 22 20:07:37 2018

Roll src/third_party/pdfium 8298d25cf3ac..c320e9c7ad01 (1 commits)

https://pdfium.googlesource.com/pdfium.git/+log/8298d25cf3ac..c320e9c7ad01


git log 8298d25cf3ac..c320e9c7ad01 --date=short --no-merges --format='%ad %ae %s'
2018-10-22 hans@chromium.org Add k prefixes to CPDF_AAction::AActionType enumerators


Created with:
  gclient setdep -r src/third_party/pdfium@c320e9c7ad01

The AutoRoll server is located here: https://autoroll.skia.org/r/pdfium-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



BUG= chromium:895475 
TBR=dsinclair@chromium.org

Change-Id: Id585126300069ede60f38273cb71f693735c4556
Reviewed-on: https://chromium-review.googlesource.com/c/1294222
Reviewed-by: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#601699}
[modify] https://crrev.com/ada8c5c5553758c69e57b9b0b758124d2966b6ec/DEPS

Project Member

Comment 26 by bugdroid1@chromium.org, Oct 22

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/27778ec04c951f875abc17b2000fff94eaff32d7

commit 27778ec04c951f875abc17b2000fff94eaff32d7
Author: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Date: Mon Oct 22 21:30:22 2018

Roll src/third_party/pdfium c320e9c7ad01..ae9bed9f4af1 (3 commits)

https://pdfium.googlesource.com/pdfium.git/+log/c320e9c7ad01..ae9bed9f4af1


git log c320e9c7ad01..ae9bed9f4af1 --date=short --no-merges --format='%ad %ae %s'
2018-10-22 thestig@chromium.org Roll v8/ 626844157..db22e96fb (203 commits)
2018-10-22 tsepez@chromium.org Fix timezone inconsistency in document methods test.
2018-10-22 hans@chromium.org Rename CPDF_Object::Type enumerators with k prefixes


Created with:
  gclient setdep -r src/third_party/pdfium@ae9bed9f4af1

The AutoRoll server is located here: https://autoroll.skia.org/r/pdfium-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



BUG= chromium:895475 
TBR=dsinclair@chromium.org

Change-Id: Iaa2bfccd1c8ae1daa2d41b7c4fc59ca2776d3eac
Reviewed-on: https://chromium-review.googlesource.com/c/1294631
Reviewed-by: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#601729}
[modify] https://crrev.com/27778ec04c951f875abc17b2000fff94eaff32d7/DEPS

Status: Fixed (was: Started)
I don't see any more warnings on the ToT bots now.

Sign in to add a comment