Make formal decisions on more C++17 features, plus cleanup.
* Stop listing std::chrono_literals as banned, since <chrono> is already banned.
* Alphabetize C++17 feature lists.
* Allow the following TBD C++17 language features:
`constexpr` lambdas
Declaring non-type template parameters with `auto`
`__has_include`
Lambda capture `this` by value (i.e. allows capturing `*this`)
`using` declaration for attributes
* Allow the following TBD C++17 library features:
3D `std::hypot`
Searchers
`std::atomic::is_always_lock_free`
`std::exclusive_scan`
`std::gcd`
`std::has_unique_object_representations`
`std::inclusive_scan`
`std::is_aggregate`
`std::is_swappable`
`std::launder`
`std::lcm`
`std::make_from_tuple`
`std::map::extract`/`std::map::merge`
Uninitialized memory algorithms
* Temporarily ban the following TBD C++17 library features. In all cases, we actually want the feature, but there's a bug open on "convert uses of our existing replacement to the C++17 version and remove it", so the ban will be reversed as part of fixing that bug:
`std::aligned_alloc`
`std::invoke`
`std::not_fn`
`std::string_view`
* Update DEPS for Abseil #includes to match current guidance.
* Update PRESUBMIT.py to match banned features above.
Bug: none
Change-Id: If53b81779df8117a84260e69979d00381ad761b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4219878
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1103511}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index c813bfc..145c24a 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1138,6 +1138,51 @@
[_THIRD_PARTY_EXCEPT_BLINK], # Not an error in third_party folders.
),
BanRule(
+ r'/\bstd::aligned_alloc\b',
+ (
+ 'std::aligned_alloc() is not yet approved for use (crbug.com/1412818).',
+ ' Use base::AlignedAlloc() instead.',
+ ),
+ True,
+ [_THIRD_PARTY_EXCEPT_BLINK], # Don't warn in third_party folders.
+ ),
+ BanRule(
+ r'/\bstd::invoke\b',
+ (
+ 'std::invoke() is not yet approved for use (crbug.com/1412520). Use ',
+ 'base::invoke() instead.',
+ ),
+ True,
+ [_THIRD_PARTY_EXCEPT_BLINK], # Don't warn in third_party folders.
+ ),
+ BanRule(
+ r'/\bstd::not_fn\b',
+ (
+ 'std::not_fn() is not yet approved for use (crbug.com/1412529). Use ',
+ 'base::not_fn() instead.',
+ ),
+ True,
+ [_THIRD_PARTY_EXCEPT_BLINK], # Don't warn in third_party folders.
+ ),
+ BanRule(
+ r'/\bstd::string_view\b',
+ (
+ 'std::string_view is not yet approved for use (crbug.com/691162). Use ',
+ 'base::StringPiece instead.',
+ ),
+ True,
+ [_THIRD_PARTY_EXCEPT_BLINK], # Don't warn in third_party folders.
+ ),
+ BanRule(
+ r'/\bstd::u16string_view\b',
+ (
+ 'std::u16string_view is not yet approved for use (crbug.com/691162). ',
+ 'Use base::StringPiece16 instead.',
+ ),
+ True,
+ [_THIRD_PARTY_EXCEPT_BLINK], # Don't warn in third_party folders.
+ ),
+ BanRule(
r'/\bRunMessageLoop\b',
(
'RunMessageLoop is deprecated, use RunLoop instead.',