Bug 191036 - [lldb-webkit] Last aliased enumerator in OptionSet is printed; should print first enumerator
Summary: [lldb-webkit] Last aliased enumerator in OptionSet is printed; should print f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-29 11:40 PDT by Daniel Bates
Modified: 2023-05-08 01:49 PDT (History)
5 users (show)

See Also:


Attachments
Patch and unit test (4.47 KB, patch)
2018-10-29 11:44 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-10-29 11:40:47 PDT
Consider the following enum:

enum Flag {
    A = 1 << 0,
    AAlias = A,
}

Pretty-printing OptionSet<Flag>(Flag::A) prints the last-most enumerator with value 2, AAlias. But I propose that it print the first enumerator with value 2, A, because aliased enumerators tend to be used in bounds check as opposed to actual set members.
Comment 1 Daniel Bates 2018-10-29 11:44:54 PDT
Created attachment 353304 [details]
Patch and unit test
Comment 2 Daniel Bates 2018-10-29 13:57:19 PDT
Comment on attachment 353304 [details]
Patch and unit test

Clearing flags on attachment: 353304

Committed r237564: <https://trac.webkit.org/changeset/237564>
Comment 3 Daniel Bates 2018-10-29 13:57:20 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2018-10-29 13:58:29 PDT
<rdar://problem/45648188>