Add a presubmit check for absl/memory/memory.h inclusion for WrapUnique
This fixes a build error on C++17 mode due to missing #include, plus
adds a presubmit check to prevent further breakage.
Bug: chromium:752720
Change-Id: I5c7d1dca0079dfe7a042650402e6f7ae28a797ba
Reviewed-on: https://webrtc-review.googlesource.com/c/124940
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26898}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index bc4eaf2..4dd6a32 100755
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -955,15 +955,16 @@
if pattern.search(contents):
continue
for _, line in f.ChangedContents():
- if 'absl::make_unique' in line:
+ if 'absl::make_unique' in line or 'absl::WrapUnique' in line:
files.append(f)
break
if len(files):
return [output_api.PresubmitError(
'Please include "absl/memory/memory.h" header for'
- ' absl::make_unique.\nThis header may or may not be included'
- ' transitively depends on the C++ standard version.',
+ ' absl::make_unique or absl::WrapUnique.\nThis header may or'
+ ' may not be included transitively depending on the C++ standard'
+ ' version.',
files)]
return []