From bd3af998439424886c641279b6f9bb6e950c7142 Mon Sep 17 00:00:00 2001 From: Stephan Hartmann Date: Sun, 18 Dec 2022 16:12:29 +0000 Subject: [PATCH] GCC: make raw_ptr::operator bool constexpr Required because autofill::internal::FormForest uses it in a constexpr method. Bug: 819294 Change-Id: Ib2258c9d98c2e7f88ad192b517b487f834a87481 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4110924 Reviewed-by: Bartek Nowierski Commit-Queue: Stephan Hartmann Cr-Commit-Position: refs/heads/main@{#1084785} --- diff --git a/base/memory/raw_ptr.h b/base/memory/raw_ptr.h index 4191f0e..a22f64b7 100644 --- a/base/memory/raw_ptr.h +++ b/base/memory/raw_ptr.h @@ -1301,7 +1301,9 @@ // possible, so use it only if absolutely necessary (e.g. for const_cast). PA_ALWAYS_INLINE T* get() const { return GetForExtraction(); } - explicit PA_ALWAYS_INLINE operator bool() const { return !!wrapped_ptr_; } + constexpr explicit PA_ALWAYS_INLINE operator bool() const { + return !!wrapped_ptr_; + } template