blob: 0a172150fc145c5c06bb99ff6fb7be4959adf627 [file] [log] [blame]
Richard Smith9dd9f032013-08-30 00:23:29 +00001class HasFriends {
2 friend void friend_1(HasFriends);
3 friend void friend_2(HasFriends);
4 void private_thing();
5};
Richard Smithb45a6f72014-04-17 20:33:01 +00006
7struct HasNontrivialDefaultConstructor {
8 HasNontrivialDefaultConstructor() = default;
9 HasNontrivialDefaultConstructor(int n = 0);
10
11 // Ensure this class is not POD but is still trivially-copyable.
12 // This is necessary to exercise the second static_assert below,
13 // because GCC's spec for __has_trivial_constructor is absurd.
14 int m;
15private:
16 int n;
17};
18
19static_assert(!__is_trivial(HasNontrivialDefaultConstructor), "");
20static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), "");
Richard Smithdebcd502014-05-16 02:14:42 +000021
22void *operator new[](__SIZE_TYPE__);
Richard Smith675d2792014-06-16 20:26:19 +000023
24extern int mergeUsedFlag;
25inline int getMergeUsedFlag() { return mergeUsedFlag; }
Richard Smith88ebade2014-08-23 01:45:27 +000026
27typedef struct {
28 int n;
29 int m;
30} NameForLinkage;
Richard Smithb1108732014-08-26 23:29:11 +000031
32struct HasVirtualFunctions {
33 virtual void f();
34};
35struct OverridesVirtualFunctions : HasVirtualFunctions {
36 void f();
37};
Richard Smithb602c7f2014-08-29 22:33:38 +000038extern "C" void ExternCFunction();
Richard Smith70d58502014-08-30 00:04:23 +000039
40typedef struct {
41 struct Inner {
42 int n;
43 };
44} NameForLinkage2;
45auto name_for_linkage2_inner_a = NameForLinkage2::Inner();
46typedef decltype(name_for_linkage2_inner_a) NameForLinkage2Inner;
Richard Smithf4634362014-09-03 23:11:22 +000047
48namespace Aliased { extern int a; }
49namespace Alias = Aliased;
Richard Smithf81c2cc2015-02-27 01:57:00 +000050
51struct InhCtorA { InhCtorA(int); };
52struct InhCtorB : InhCtorA { using InhCtorA::InhCtorA; };
Richard Smith9c4fb0a2016-04-14 18:32:54 +000053
54struct ClassWithVBases : HasFriends, virtual HasNontrivialDefaultConstructor {
55 int n;
56};
57struct ClassWithVBases;