WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
69414
Using RetainPtr as the key type in HashMap/HashSet fails to compile
https://bugs.webkit.org/show_bug.cgi?id=69414
Summary
Using RetainPtr as the key type in HashMap/HashSet fails to compile
Adam Roben (:aroben)
Reported
2011-10-05 05:20:47 PDT
The following code fails to compile: HashSet<RetainPtr<CFStringRef> > set; Here are some of the errors: JavaScriptCore.framework/PrivateHeaders/RetainPtr.h:70:61:{70:55-70:60}{70:64-70:87}: error: comparison of distinct pointer types ('PtrType' (aka 'const __CFString *') and 'const __CFString **') [2] bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); } ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~ JavaScriptCore.framework/PrivateHeaders/HashTraits.h:90:67: note: in instantiation of member function 'WTF::RetainPtr<const __CFString *>::isHashTableDeletedValue' requested here [2] static bool isDeletedValue(const T& value) { return value.isHashTableDeletedValue(); } ^ JavaScriptCore.framework/PrivateHeaders/HashTable.h:342:81: note: in instantiation of member function 'WTF::SimpleClassHashTraits<WTF::RetainPtr<const __CFString *> >::isDeletedValue' requested here [2] static bool isDeletedBucket(const ValueType& value) { return KeyTraits::isDeletedValue(Extractor::extract(value)); } ^ JavaScriptCore.framework/PrivateHeaders/HashTable.h:891:22: note: in instantiation of member function 'WTF::HashTable<WTF::RetainPtr<const __CFString *>, WTF::RetainPtr<const __CFString *>, WTF::IdentityExtractor<WTF::RetainPtr<const __CFString *> >, WTF::PtrHash<WTF::RetainPtr<const __CFString *> >, WTF::HashTraits<WTF::RetainPtr<const __CFString *> >, WTF::HashTraits<WTF::RetainPtr<const __CFString *> > >::isDeletedBucket' requested here [2] if (!isDeletedBucket(table[i])) ^ JavaScriptCore.framework/PrivateHeaders/HashTable.h:300:13: note: in instantiation of member function 'WTF::HashTable<WTF::RetainPtr<const __CFString *>, WTF::RetainPtr<const __CFString *>, WTF::IdentityExtractor<WTF::RetainPtr<const __CFString *> >, WTF::PtrHash<WTF::RetainPtr<const __CFString *> >, WTF::HashTraits<WTF::RetainPtr<const __CFString *> >, WTF::HashTraits<WTF::RetainPtr<const __CFString *> > >::deallocateTable' requested here [2] deallocateTable(m_table, m_tableSize); ^ JavaScriptCore.framework/PrivateHeaders/HashSet.h:38:59: note: in instantiation of member function 'WTF::HashTable<WTF::RetainPtr<const __CFString *>, WTF::RetainPtr<const __CFString *>, WTF::IdentityExtractor<WTF::RetainPtr<const __CFString *> >, WTF::PtrHash<WTF::RetainPtr<const __CFString *> >, WTF::HashTraits<WTF::RetainPtr<const __CFString *> >, WTF::HashTraits<WTF::RetainPtr<const __CFString *> > >::~HashTable' requested here [2] typename TraitsArg = HashTraits<ValueArg> > class HashSet { ^
Attachments
Ensure RetainPtr::hashTableDeletedValue returns a pointer, not a pointer to a pointer
(15.98 KB, patch)
2011-10-05 05:37 PDT
,
Adam Roben (:aroben)
sullivan
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2011-10-05 05:21:03 PDT
<
rdar://problem/10236833
>
Adam Roben (:aroben)
Comment 2
2011-10-05 05:30:19 PDT
Looks like HashMap<RetainPtr<CFStringRef>, int> also fails to compile.
Adam Roben (:aroben)
Comment 3
2011-10-05 05:37:50 PDT
Created
attachment 109777
[details]
Ensure RetainPtr::hashTableDeletedValue returns a pointer, not a pointer to a pointer
Adam Roben (:aroben)
Comment 4
2011-10-05 15:22:16 PDT
Committed
r96757
: <
http://trac.webkit.org/changeset/96757
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug