StringImpl: Move AllocationSize() specialization out of class declaration

This fixes the GCC build after commit fdb5f28 ("Use a more obviously-correct
way to calculate allocation sizes"):

In file included from ../../third_party/blink/renderer/platform/wtf/text/wtf_string.h:33,
                 from ../../third_party/blink/renderer/platform/wtf/decimal.h:38,
                 from ../../third_party/blink/renderer/platform/wtf/decimal_test.cc:31:
../../third_party/blink/renderer/platform/wtf/text/string_impl.h:453:13: error: explicit specialization in non-namespace scope ‘class WTF::StringImpl’
   template <>
             ^
../../third_party/blink/renderer/platform/wtf/text/string_impl.h:454:49: error: template-id ‘AllocationSize<LChar>’ in declaration of primary template
   size_t AllocationSize<LChar>(wtf_size_t length) {
                                                 ^
../../third_party/blink/renderer/platform/wtf/text/string_impl.h:467:29: error: too many template-parameter-lists
   scoped_refptr<StringImpl> StripMatchedCharacters(UCharPredicate);
                             ^~~~~~~~~~~~~~~~~~~~~~
../../third_party/blink/renderer/platform/wtf/text/string_impl.h:469:29: error: too many template-parameter-lists
   scoped_refptr<StringImpl> SimplifyMatchedCharactersToSpace(UCharPredicate,
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Move the new template specialization outside of StringImpl. Having it in
StringImpl officially requires C++17 (specifically, C++ DR727). While clang
has implemented DR727 for other -std= options, GCC is stricter and only
builds that code in C++17 mode.

Bug: 819294
Change-Id: I0ab17347b3c9fc75f36c471933eb523ad134d869
Reviewed-on: https://chromium-review.googlesource.com/c/1454533
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629217}
1 file changed