|
|
Created:
6 years, 3 months ago by Mostyn Bramley-Moore Modified:
6 years, 3 months ago Reviewers:
haraken, wibling-chromium, Nico, zerny-chromium, Mads Ager (chromium) CC:
blink-reviews, kouhei+heap_chromium.org Base URL:
https://chromium.googlesource.com/chromium/blink.git@master Project:
blink Visibility:
Public. |
Descriptionremove template c++11'ism in Heap.h
Followup to CL 486193002 to remove default arguments from template types,
which is only allowed in c++11 and later (and we haven't officially switched
to c++11 yet afaik).
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181719
Patch Set 1 #
Total comments: 4
Patch Set 2 : remove code duplication #
Created: 6 years, 3 months ago
Messages
Total messages: 13 (3 generated)
mostynb@opera.com changed reviewers: + ager@chromium.org, haraken@chromium.org, wibling@chromium.org, zerny@chromium.org
@haraken, wibling, mads, zerny: please take a look...
What's the benefit of this change?
https://codereview.chromium.org/559733004/diff/1/Source/platform/heap/Heap.h File Source/platform/heap/Heap.h (right): https://codereview.chromium.org/559733004/diff/1/Source/platform/heap/Heap.h#... Source/platform/heap/Heap.h:1107: // TODO(mostynb) remove this once c++11 is allowed, in favour of the one TODO(mostynb) => FIXME https://codereview.chromium.org/559733004/diff/1/Source/platform/heap/Heap.h#... Source/platform/heap/Heap.h:1580: // TODO(mostynb) remove this once c++11 is allowed, in favour of the one above: Ditto.
I would prefer not to add code duplication if this does not break compilation on any of our supported systems (which as far as I can tell it doesn't).
Default template arguments are not a c++11 feature as far as I know? Template parameter pack arguments are a c++11 feature, but that is not what we are using here. http://en.cppreference.com/w/cpp/language/template_parameters Default template arguments are used in many places in Blink. In particular they are used heavily in WTF collection and here in the GC infrastructure.
mostynb@opera.com changed reviewers: + thakis@chromium.org
On 2014/09/10 00:51:03, haraken wrote: > What's the benefit of this change? This allows this code to build on non-c++11 toolchains a little longer. Last I heard from Nico on chromium-dev was that we're supposed to hold off on c++11 a little longer. I can keep this as a local patch while migrating all my toolchains/targets to gcc >= 4.8, but I guess Nico has some reasons for wanting to hold back on c++11 for you guys too. On 2014/09/10 06:48:10, Mads Ager (chromium) wrote: > I would prefer not to add code duplication if this does not break compilation on > any of our supported systems (which as far as I can tell it doesn't). Removed the duplication in patchset 2, making this quite a bit simpler. > Default template arguments are not a c++11 feature as far as I know? Template > parameter pack arguments are a c++11 feature, but that is not what we are using > here. > > http://en.cppreference.com/w/cpp/language/template_parameters > > Default template arguments are used in many places in Blink. In particular they > are used heavily in WTF collection and here in the GC infrastructure. I'm not sure why this hasn't been a problem elsewhere, but GCC's documentation lists this as a c++11 feature, see the "Default template arguments for function templates" entry: https://gcc.gnu.org/projects/cxx0x.html This is the error I get when building without this patch (my local tree, so the line numbers might differ) with ubuntu 14.04's g++-4.6: In file included from ../../third_party/WebKit/Source/platform/heap/Handle.h:34:0, from ../../third_party/WebKit/public/platform/WebPrivatePtr.h:37, from ../../third_party/WebKit/public/platform/WebPrerender.h:35, from ../../third_party/WebKit/Source/platform/Prerender.cpp:36: ../../third_party/WebKit/Source/platform/heap/Heap.h:1088:97: error: default template arguments may not be used in function templates without -std=c++0x or -std=gnu++0x If I sub in g++-4.7 in the build command, without rerunning gyp, I get the same error except it uses the term c++11 and gnu++11 instead. (If I rerun gyp then -std=gnu++11 is used for gcc >= 4.7). https://codereview.chromium.org/559733004/diff/1/Source/platform/heap/Heap.h File Source/platform/heap/Heap.h (right): https://codereview.chromium.org/559733004/diff/1/Source/platform/heap/Heap.h#... Source/platform/heap/Heap.h:1107: // TODO(mostynb) remove this once c++11 is allowed, in favour of the one On 2014/09/10 00:51:10, haraken wrote: > > TODO(mostynb) => FIXME Done. https://codereview.chromium.org/559733004/diff/1/Source/platform/heap/Heap.h#... Source/platform/heap/Heap.h:1580: // TODO(mostynb) remove this once c++11 is allowed, in favour of the one above: On 2014/09/10 00:51:10, haraken wrote: > > Ditto. Done.
LGTM Sorry about that; I was thinking about default template arguments for classes which has been available forever. Thanks for the simplification! :)
The CQ bit was checked by mostynb@opera.com
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mostynb@opera.com/559733004/20001
LGTM
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as 181719 |