New issue
Advanced search Search tips

Issue 640688 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 578344



Sign in to add a comment

rewrite_to_chrome_style: Method definitions for WTF namespace not rewritten if outside of actual namespace node

Project Member Reported by lukasza@chromium.org, Aug 24 2016

Issue description

Example:

wtf/text/StringConcatenate.h:

    namespace WTF {  // <- ***** namespace here
    
    template<typename StringType>
    class StringTypeAdapter {
        DISALLOW_NEW();
    };
    
    template<>
    class StringTypeAdapter<char*> {
    ...
    public:
    ...
        // ***** We will rewrite |writeTo| to |WriteTo| below
        //       (since we are in WTF namespace).
        void writeTo(LChar* destination);
    ...
    };

wtf/text/StringConcatenate.cpp:

    // ***** no |namespace WTF {| here
    // but obviously method definition below is for WTF namespace
    // (because of the explicit nested name qualifier).

    ...
    // ***** BUG: need to rewrite |writeTo| to |WriteTo|
    //       (rewrite doesn't happen because there is no namespace node
    //        inside StringConcatenate.cpp)
    void WTF::StringTypeAdapter<char*>::writeTo(LChar* destination)
    {
        for (unsigned i = 0; i < m_length; ++i)
            destination[i] = static_cast<LChar>(m_buffer[i]);
    }
    ...
 

Comment 1 by danakj@chromium.org, Aug 24 2016

Ah this is probably down to how we check namespace, we look for an ancestor block, but there must be something else to look for too (or instead)
Fix proposed at https://codereview.chromium.org/2271203004 (it seems to work fine on StringConcatenate.cpp).
Status: Started (was: Untriaged)
Status: Fixed (was: Started)

Sign in to add a comment