Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: tools/clang/plugins/tests/trivial_ctor.h

Issue 2483973003: Treat std::atomic_int as a trivial class member when checking for non-trivial classes. (Closed)
Patch Set: Add a test, and fix a typo. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef TRIVIAL_CTOR_H_
6 #define TRIVIAL_CTOR_H_
7
8 template<typename T>
9 struct atomic {
10 /*
11 atomic() noexcept = default;
12 ~atomic() noexcept = default;
13 atomic(const atomic&) = delete;
14 atomic& operator=(const atomic&) = delete;
15 atomic& operator=(const atomic&) volatile = delete;
16
17 constexpr atomic(T i) noexcept : i(i) { }
18 */
19
20 T i;
21 };
22
23 typedef atomic<int> atomic_int;
24
25 struct MySpinLock {
26 MySpinLock();
27 ~MySpinLock();
28 MySpinLock(const MySpinLock&);
29 MySpinLock(MySpinLock&&);
30 atomic_int lock_;
31 };
32
33 #endif // TRIVIAL_CTOR_H_
OLDNEW
« no previous file with comments | « tools/clang/plugins/FindBadConstructsConsumer.cpp ('k') | tools/clang/plugins/tests/trivial_ctor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698