blob: b8c371f748f43b09ebc602d8ac42ca058e19fbdb [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/memory/ref_counted.h"
namespace base {
class InitialRefCountIsZero : public base::RefCounted<InitialRefCountIsZero> {
InitialRefCountIsZero() {}
friend class base::RefCounted<InitialRefCountIsZero>;
~InitialRefCountIsZero() {}
// TODO(hans): Remove .* and update the static_assert expectations once we roll
// past Clang r313315.
#if defined(NCTEST_ADOPT_REF_TO_ZERO_START) // [r"fatal error: static_assert failed .*\"Use AdoptRef only for the reference count starts from one\.\""]
void WontCompile() {
AdoptRef(new InitialRefCountIsZero());
} // namespace base