Duplicate keys in a literal break NSDictionary's invariants.
Fixes rdar://50454461
Paths
| Differential D78660
[SemaObjC] Add a warning for dictionary literals with duplicate keys ClosedPublic Authored by erik.pilkington on Apr 22 2020, 11:53 AM.
Details Summary Duplicate keys in a literal break NSDictionary's invariants. Fixes rdar://50454461
Diff Detail
Event TimelineHerald added subscribers: ributzka, dexonsmith, jkorous. · View Herald TranscriptApr 22 2020, 11:53 AM Comment Actions Some part of me wishes we could use expression profiling or ODR hashing or something like that for this, but I guess the semantics we're going for don't really match.
This revision is now accepted and ready to land.May 5 2020, 2:21 AM erik.pilkington added inline comments.
Comment Actions Anyway, LGTM.
Closed by commit rG873e27909539: [SemaObjC] Add a warning for dictionary literals with duplicate keys (authored by erik.pilkington). · Explain WhyMay 5 2020, 12:58 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 262195 clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaExprObjC.cpp
clang/test/SemaObjC/dictionary-literal-duplicates.m
|
Does EvaluateAsInt really just fail cleanly if the argument doesn't have integral type?