rewrite_to_chrome_style: Method definitions for WTF namespace not rewritten if outside of actual namespace node |
|||
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]);
}
...
,
Aug 24 2016
Fix proposed at https://codereview.chromium.org/2271203004 (it seems to work fine on StringConcatenate.cpp).
,
Aug 24 2016
,
Aug 30 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f5e43f031c552c4461cc0451c54662c9f099dbe0 commit f5e43f031c552c4461cc0451c54662c9f099dbe0 Author: lukasza <lukasza@chromium.org> Date: Tue Aug 30 04:35:52 2016 Tweak |in_blink_namespace|, to look at ancestors *and also* at qualifiers. BUG= 640688 Review-Url: https://codereview.chromium.org/2271203004 Cr-Commit-Position: refs/heads/master@{#415101} [modify] https://crrev.com/f5e43f031c552c4461cc0451c54662c9f099dbe0/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp [modify] https://crrev.com/f5e43f031c552c4461cc0451c54662c9f099dbe0/tools/clang/rewrite_to_chrome_style/tests/functions-expected.cc [modify] https://crrev.com/f5e43f031c552c4461cc0451c54662c9f099dbe0/tools/clang/rewrite_to_chrome_style/tests/functions-original.cc [modify] https://crrev.com/f5e43f031c552c4461cc0451c54662c9f099dbe0/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc [modify] https://crrev.com/f5e43f031c552c4461cc0451c54662c9f099dbe0/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc
,
Sep 2 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by danakj@chromium.org
, Aug 24 2016