[webkit-dev] initializing protected variable in a subclass

Chris Fleizach cfleizach at apple.com
Mon Aug 3 15:51:46 PDT 2009


I have added

protected:
     AccessibilityRole m_role;

to AccessibilityObject.h

I want to initialize that variable in subclasses of  
AccessibilityObject, like so

AccessibilityImageMapLink::AccessibilityImageMapLink()
     : m_role(WebCoreLinkRole)

but the compiler says


/Volumes/data/WebKit/WebCore/accessibility/ 
AccessibilityImageMapLink.cpp:48: error: class  
‘WebCore::AccessibilityImageMapLink’ does not have any field named  
‘m_role’

even though this works fine

AccessibilityImageMapLink::AccessibilityImageMapLink()
{
     m_role = WebCoreLinkRole;
}

any tips?

thanx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090803/849d0b3f/attachment.html>


More information about the webkit-dev mailing list