Bug 217791

Summary: PDFPlugin.mm:2303:139: error: type 'SEL _Nullable' cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing]
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: PDFAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch v1 none

Description David Kilzer (:ddkilzer) 2020-10-15 15:53:44 PDT
Issue found by open source clang:

In file included from WebKitBuild/Release/DerivedSources/WebKit2/unified-sources/UnifiedSource55-mm.mm:3:
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:2303:139: error: type 'SEL _Nullable' cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing]
        PDFContextMenuItem menuItem { String([item title]), !![item isEnabled], !![item isSeparatorItem], static_cast<int>([item state]), [item action], i };
                                                                                                                                          ^~~~~~~~~~~~~
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:2303:139: note: insert an explicit cast to silence this issue
        PDFContextMenuItem menuItem { String([item title]), !![item isEnabled], !![item isSeparatorItem], static_cast<int>([item state]), [item action], i };
                                                                                                                                          ^~~~~~~~~~~~~
                                                                                                                                          static_cast<bool>( )

<rdar://problem/70349804>
Comment 1 David Kilzer (:ddkilzer) 2020-10-15 15:56:49 PDT
Created attachment 411502 [details]
Patch v1
Comment 2 EWS 2020-10-15 17:06:21 PDT
Committed r268562: <https://trac.webkit.org/changeset/268562>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 411502 [details].