Replace most TypeTraits with <type_traits> alternatives
Categories
(Core :: MFBT, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox76 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(41 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1625138 - Part 2: Replace mozilla::AddLvalueReference with std::add_lvalue_reference. r=froydnj!
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
TypeTraits which aren't handled in this bug:
IsDestructible
and the TypeTraits which are transitively used from it (DeclVal
,AddRvalueReference
,IsVoid
,FalseType
,TrueType
,RemoveCV
,IntegralConstant
,RemoveConst
,RemoveVolatile
). These can't be replaced with<type_traits>
until theMOZ_CAN_RUN_SCRIPT
checker has been updated to supportstd::is_destructible
. [1]EnableIf
: bug 1606962IsSame
: Has too many in-tree uses, should probably be handled in a separate bug.IsPod
: bug 900042
[1] Using std::is_destructible
reports the following errors on OSX:
[task 2020-03-25T18:39:52.026Z] 18:39:52 ERROR - /builds/worker/fetches/clang/bin/../include/c++/v1/type_traits:2225:51: error: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument). '_VSTD::declval<_Tp1&>()' is neither.
[task 2020-03-25T18:39:52.026Z] 18:39:52 INFO - typename __is_destructible_apply<decltype(_VSTD::declval<_Tp1&>().~_Tp1())>::type
[task 2020-03-25T18:39:52.026Z] 18:39:52 INFO - ^~~~~~~~~~~~~~~~~~~~~~~
[task 2020-03-25T18:39:52.026Z] 18:39:52 INFO - /builds/worker/fetches/clang/bin/../include/c++/v1/__config:758:15: note: expanded from macro '_VSTD'
[task 2020-03-25T18:39:52.026Z] 18:39:52 INFO - #define _VSTD std::_LIBCPP_ABI_NAMESPACE
[task 2020-03-25T18:39:52.026Z] 18:39:52 INFO - ^
and
[task 2020-03-25T18:39:52.027Z] 18:39:52 ERROR - /builds/worker/fetches/clang/bin/../include/c++/v1/type_traits:2225:51: error: functions marked as MOZ_CAN_RUN_SCRIPT can only be called from functions also marked as MOZ_CAN_RUN_SCRIPT
[task 2020-03-25T18:39:52.029Z] 18:39:52 INFO - typename __is_destructible_apply<decltype(_VSTD::declval<_Tp1&>().~_Tp1())>::type
[task 2020-03-25T18:39:52.029Z] 18:39:52 INFO - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2020-03-25T18:39:52.029Z] 18:39:52 INFO - /builds/worker/fetches/clang/bin/../include/c++/v1/__config:758:15: note: expanded from macro '_VSTD'
[task 2020-03-25T18:39:52.029Z] 18:39:52 INFO - #define _VSTD std::_LIBCPP_ABI_NAMESPACE
[task 2020-03-25T18:39:52.029Z] 18:39:52 INFO - ^
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D68355
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D68356
Assignee | ||
Comment 4•5 years ago
|
||
Depends on D68357
Assignee | ||
Comment 5•5 years ago
|
||
Depends on D68358
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D68359
Assignee | ||
Comment 7•5 years ago
|
||
Depends on D68360
Assignee | ||
Comment 8•5 years ago
|
||
Depends on D68361
Assignee | ||
Comment 9•5 years ago
|
||
Depends on D68362
Assignee | ||
Comment 10•5 years ago
|
||
Depends on D68363
Assignee | ||
Comment 11•5 years ago
|
||
Depends on D68364
Assignee | ||
Comment 12•5 years ago
|
||
Depends on D68365
Assignee | ||
Comment 13•5 years ago
|
||
Depends on D68366
Assignee | ||
Comment 14•5 years ago
|
||
Depends on D68368
Assignee | ||
Comment 15•5 years ago
|
||
Depends on D68369
Assignee | ||
Comment 16•5 years ago
|
||
Depends on D68370
Assignee | ||
Comment 17•5 years ago
|
||
Depends on D68371
Assignee | ||
Comment 18•5 years ago
|
||
Depends on D68372
Assignee | ||
Comment 19•5 years ago
|
||
Depends on D68373
Assignee | ||
Comment 20•5 years ago
|
||
Depends on D68374
Assignee | ||
Comment 21•5 years ago
|
||
Depends on D68375
Assignee | ||
Comment 22•5 years ago
|
||
Depends on D68376
Assignee | ||
Comment 23•5 years ago
|
||
Depends on D68377
Assignee | ||
Comment 24•5 years ago
|
||
Depends on D68378
Assignee | ||
Comment 25•5 years ago
|
||
Depends on D68379
Assignee | ||
Comment 26•5 years ago
|
||
Depends on D68380
Assignee | ||
Comment 27•5 years ago
|
||
(In reply to André Bargull [:anba] from comment #0)
TypeTraits which aren't handled in this bug:
IsDestructible
and the TypeTraits which are transitively used from it (DeclVal
,AddRvalueReference
,IsVoid
,FalseType
,TrueType
,RemoveCV
,IntegralConstant
,RemoveConst
,RemoveVolatile
). These can't be replaced with<type_traits>
until theMOZ_CAN_RUN_SCRIPT
checker has been updated to supportstd::is_destructible
. [1]IsSame
: Has too many in-tree uses, should probably be handled in a separate bug.
So, it looks like it's possible to replace mozilla::DeclVal
with std::declval
in mozilla::IsDestructible
without triggering bug 1625152. That means we can actually also replace DeclVal
, AddRvalueReference
, IsVoid
, FalseType
, TrueType
, RemoveCV
, IntegralConstant
, RemoveConst
, RemoveVolatile
with their <type_traits>
alternatives. But when those are also replaced, I'll handle IsSame
here, too, for the sake of completeness.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 28•5 years ago
|
||
Depends on D68401
Assignee | ||
Comment 29•5 years ago
|
||
Depends on D68545
Assignee | ||
Comment 30•5 years ago
|
||
Depends on D68546
Assignee | ||
Comment 31•5 years ago
|
||
Depends on D68547
Assignee | ||
Comment 32•5 years ago
|
||
Depends on D68548
Assignee | ||
Comment 33•5 years ago
|
||
Depends on D68549
Assignee | ||
Comment 34•5 years ago
|
||
Depends on D68551
Assignee | ||
Comment 35•5 years ago
|
||
Depends on D68552
Assignee | ||
Comment 36•5 years ago
|
||
Depends on D68553
Assignee | ||
Comment 37•5 years ago
|
||
Depends on D68554
Assignee | ||
Comment 38•5 years ago
|
||
Depends on D68555
Assignee | ||
Comment 39•5 years ago
|
||
Depends on D68556
Assignee | ||
Comment 40•5 years ago
|
||
Depends on D68557
Assignee | ||
Comment 41•5 years ago
|
||
Depends on D68558
Assignee | ||
Comment 42•5 years ago
|
||
Also adds missing includes in some files, these were previously only transivitely
included through mozilla/TypeTraits.h.
Depends on D68560
Comment 45•5 years ago
|
||
Comment 46•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/733dde3fe35b
https://hg.mozilla.org/mozilla-central/rev/112b7ff16977
https://hg.mozilla.org/mozilla-central/rev/f1c42129fb0b
https://hg.mozilla.org/mozilla-central/rev/54f1de92d76e
https://hg.mozilla.org/mozilla-central/rev/847189efca00
https://hg.mozilla.org/mozilla-central/rev/ae96b293b960
https://hg.mozilla.org/mozilla-central/rev/a68131de6bea
https://hg.mozilla.org/mozilla-central/rev/463d286fcce9
https://hg.mozilla.org/mozilla-central/rev/14d9ef35878e
https://hg.mozilla.org/mozilla-central/rev/9156b33cd5ef
https://hg.mozilla.org/mozilla-central/rev/f53bdabacea4
https://hg.mozilla.org/mozilla-central/rev/ca9941c7dc19
https://hg.mozilla.org/mozilla-central/rev/4dd33e11fc70
https://hg.mozilla.org/mozilla-central/rev/05ebb33de1f9
https://hg.mozilla.org/mozilla-central/rev/83a01c8c31c7
https://hg.mozilla.org/mozilla-central/rev/8bbf59d19fa0
https://hg.mozilla.org/mozilla-central/rev/1717b0704c0e
https://hg.mozilla.org/mozilla-central/rev/c69047027239
https://hg.mozilla.org/mozilla-central/rev/075f2316d9dd
https://hg.mozilla.org/mozilla-central/rev/fe17133c853f
https://hg.mozilla.org/mozilla-central/rev/71ed5558e930
https://hg.mozilla.org/mozilla-central/rev/ba1a4349471c
https://hg.mozilla.org/mozilla-central/rev/056c1df81242
https://hg.mozilla.org/mozilla-central/rev/d9345db452b3
https://hg.mozilla.org/mozilla-central/rev/1b923628c0e3
https://hg.mozilla.org/mozilla-central/rev/c12439823ae9
https://hg.mozilla.org/mozilla-central/rev/79be64101af3
https://hg.mozilla.org/mozilla-central/rev/f7c195e843e1
https://hg.mozilla.org/mozilla-central/rev/d62b8cbbb055
https://hg.mozilla.org/mozilla-central/rev/323db95684b7
https://hg.mozilla.org/mozilla-central/rev/10643b2c4d6b
https://hg.mozilla.org/mozilla-central/rev/8e597f5deb77
https://hg.mozilla.org/mozilla-central/rev/53733a2a5f06
https://hg.mozilla.org/mozilla-central/rev/215f8c06c6d7
https://hg.mozilla.org/mozilla-central/rev/d1c40df1a74b
https://hg.mozilla.org/mozilla-central/rev/a62dff0a7b04
https://hg.mozilla.org/mozilla-central/rev/3c82c7e7eb60
https://hg.mozilla.org/mozilla-central/rev/85b79a5f1f0b
https://hg.mozilla.org/mozilla-central/rev/cbee2c2ada09
https://hg.mozilla.org/mozilla-central/rev/43badf8b568e
https://hg.mozilla.org/mozilla-central/rev/29693da8f958
![]() |
||
Comment 47•5 years ago
|
||
Thank you for doing this, anba!
Description
•