[Webkit-unassigned] [Bug 113454] GCC 4.8 error - C++ nested class inheriting enclosing class
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 28 20:29:43 PDT 2013
https://bugs.webkit.org/show_bug.cgi?id=113454
Benjamin Poulain <benjamin at webkit.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #195676|review? |review+
Flag| |
--- Comment #12 from Benjamin Poulain <benjamin at webkit.org> 2013-03-28 20:27:54 PST ---
(From update of attachment 195676)
View in context: https://bugs.webkit.org/attachment.cgi?id=195676&action=review
> Source/WTF/ChangeLog:38
> + Original code has nested classes that have enclosing class as their parent, illustrated below -
> + template class <typename T>
> + class HashMap {
> + ... ...
> + ... ...
> + private:
> + class HashMapKeysProxy;
> +
> + // ERROR - nested class inherits enclosing class.
> + class HashMapKeysProxy : private HashMap {
> + };
> + ... ...
> + ... ...
> + };
> +
> + Fixed as below:
> + template class <typename T>
> + class HashMap {
> + ... ...
> + ... ...
> + private:
> + class HashMapKeysProxy;
> +
> + ... ...
> + ... ...
> + };
> +
> + template <typename T>
> + class HashMap<T>::HashMapKeysProxy : private HashMap<T> {
> + ... ...
> + };
The patch is great but I am still not happy about the ChangeLog.
What you need is explain what, why and how.
Basically explain: the previous code does not build on GCC 4.8. The reason is HashMapKeysProxy and HashMapValuesProxy are defined as nested class inside HashMap, which is illegal (you can like to a spec if possible). The solution here is to move the said definitions outside of HashMap.
> Source/WTF/wtf/HashMap.h:264
> - m_impl.swap(other.m_impl);
> + m_impl.swap(other.m_impl);
> }
>
> template<typename T, typename U, typename V, typename W, typename X>
> inline int HashMap<T, U, V, W, X>::size() const
> {
> - return m_impl.size();
> + return m_impl.size();
> }
>
> template<typename T, typename U, typename V, typename W, typename X>
> inline int HashMap<T, U, V, W, X>::capacity() const
> - {
> - return m_impl.capacity();
> + {
> + return m_impl.capacity();
> }
Better leave those unchanged, it is unrelated with your fix.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list