1// Copyright 2021 The Chromium Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5// This is a "No Compile Test" suite. 6// http://dev.chromium.org/developers/testing/no-compile-tests 7 8#include "base/no_destructor.h" 9 10namespace base { 11 12void WontCompile() { 13 // NoDestructor should only be used for non-trivially destructible types; 14 // trivial types can simply be directly declared as globals. 15 static NoDestructor<bool> x; // expected-error@*:* {{static assertion failed due to requirement '!std::is_trivially_destructible_v<bool>'}} 16} 17 18} // namespace base 19