Commit b8a14930 authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

Disable disable_observer_list_unittest.nc

It fails with tip-of-tree Clang because the diagnositics have changed
slightly. Disable for now and possible re-enable with updated
expectations after the next Clang roll.

TBR=thakis

Bug: 912021
Change-Id: Ib0d83178ea5c38fa2d19ada720e8526437c916fd
Reviewed-on: https://chromium-review.googlesource.com/c/1365434Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614306}
parent ad030e8d
...@@ -2819,7 +2819,6 @@ if (enable_nocompile_tests) { ...@@ -2819,7 +2819,6 @@ if (enable_nocompile_tests) {
"memory/weak_ptr_unittest.nc", "memory/weak_ptr_unittest.nc",
"metrics/field_trial_params_unittest.nc", "metrics/field_trial_params_unittest.nc",
"metrics/histogram_unittest.nc", "metrics/histogram_unittest.nc",
"observer_list_unittest.nc",
"optional_unittest.nc", "optional_unittest.nc",
"strings/string16_unittest.nc", "strings/string16_unittest.nc",
"task/task_traits_extension_unittest.nc", "task/task_traits_extension_unittest.nc",
......
// Copyright 2018 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.
// This is a "No Compile Test" suite.
// http://dev.chromium.org/developers/testing/no-compile-tests
#include <type_traits>
#include "base/observer_list.h"
namespace base {
#if defined(NCTEST_CHECKED_OBSERVER_USING_UNCHECKED_LIST) // [r"fatal error: static_assert failed due to requirement '!std::is_base_of<CheckedObserver, Observer>::value' \"CheckedObserver classes must not use ObserverList<T>::Unchecked.\""]
void WontCompile() {
struct Observer : public CheckedObserver {
void OnObserve() {}
};
ObserverList<Observer>::Unchecked list;
for (auto& observer: list)
observer.OnObserve();
}
#elif defined(NCTEST_UNCHECKED_OBSERVER_USING_CHECKED_LIST) // [r"fatal error: static_assert failed due to requirement 'std::is_base_of<CheckedObserver, UncheckedObserver>::value' \"Observers should inherit from base::CheckedObserver. Use ObserverList<T>::Unchecked to observe with raw pointers.\""]
void WontCompile() {
struct UncheckedObserver {
void OnObserve() {}
};
ObserverList<UncheckedObserver> list;
for (auto& observer: list)
observer.OnObserve();
}
#endif
} // namespace base
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment