| Peter Kasting | 0bc6a68 | 2024-09-09 09:38:34 | [diff] [blame] | 1 | // Copyright 2024 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/run_loop.h" |
| 9 | #include "base/task/sequenced_task_runner.h" |
| 10 | |
| 11 | namespace base { |
| 12 | |
| 13 | void LvalueQuitClosure() { |
| 14 | auto task_runner = SequencedTaskRunner::GetCurrentDefault(); |
| 15 | task_runner->PostTask(FROM_HERE, RunLoop().QuitClosure()); // expected-error@*:* {{'this' argument to member function 'QuitClosure' is an rvalue, but function has non-const lvalue ref-qualifier}} |
| 16 | task_runner->PostTask(FROM_HERE, RunLoop().QuitWhenIdleClosure()); // expected-error@*:* {{'this' argument to member function 'QuitWhenIdleClosure' is an rvalue, but function has non-const lvalue ref-qualifier}} |
| 17 | } |
| 18 | |
| 19 | } // namespace base |