aboutsummaryrefslogtreecommitdiff
path: root/tools/clang/plugins/tests/trivial_ctor.cpp
blob: c632fafe747d26342a8a67e875b35bdea703dedf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) 2016 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 "trivial_ctor.h"

// Due to https://bugs.chromium.org/p/chromium/issues/detail?id=663463, we treat
// templated classes/structs as non-trivial, even if they really are trivial.
// Thus, classes that have such a class/struct as a member get flagged as being
// themselves non-trivial, even if (like |MySpinLock|) they are. Special-case
// [std::]atomic_int.
class TrivialTemplateOK {
 private:
  MySpinLock lock_;
};

int main() {
  MySpinLock lock;
  TrivialTemplateOK one;
  return 0;
}