Richard Smith | 9dd9f03 | 2013-08-30 00:23:29 +0000 | [diff] [blame] | 1 | class HasFriends { |
| 2 | friend void friend_1(HasFriends); |
| 3 | friend void friend_2(HasFriends); |
| 4 | void private_thing(); |
| 5 | }; |
Richard Smith | b45a6f7 | 2014-04-17 20:33:01 +0000 | [diff] [blame] | 6 | |
| 7 | struct 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; |
| 15 | private: |
| 16 | int n; |
| 17 | }; |
| 18 | |
| 19 | static_assert(!__is_trivial(HasNontrivialDefaultConstructor), ""); |
| 20 | static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), ""); |
Richard Smith | debcd50 | 2014-05-16 02:14:42 +0000 | [diff] [blame] | 21 | |
| 22 | void *operator new[](__SIZE_TYPE__); |
Richard Smith | 675d279 | 2014-06-16 20:26:19 +0000 | [diff] [blame] | 23 | |
| 24 | extern int mergeUsedFlag; |
| 25 | inline int getMergeUsedFlag() { return mergeUsedFlag; } |
Richard Smith | 88ebade | 2014-08-23 01:45:27 +0000 | [diff] [blame] | 26 | |
| 27 | typedef struct { |
| 28 | int n; |
| 29 | int m; |
| 30 | } NameForLinkage; |
Richard Smith | b110873 | 2014-08-26 23:29:11 +0000 | [diff] [blame] | 31 | |
| 32 | struct HasVirtualFunctions { |
| 33 | virtual void f(); |
| 34 | }; |
| 35 | struct OverridesVirtualFunctions : HasVirtualFunctions { |
| 36 | void f(); |
| 37 | }; |
Richard Smith | b602c7f | 2014-08-29 22:33:38 +0000 | [diff] [blame] | 38 | extern "C" void ExternCFunction(); |
Richard Smith | 70d5850 | 2014-08-30 00:04:23 +0000 | [diff] [blame] | 39 | |
| 40 | typedef struct { |
| 41 | struct Inner { |
| 42 | int n; |
| 43 | }; |
| 44 | } NameForLinkage2; |
| 45 | auto name_for_linkage2_inner_a = NameForLinkage2::Inner(); |
| 46 | typedef decltype(name_for_linkage2_inner_a) NameForLinkage2Inner; |
Richard Smith | f463436 | 2014-09-03 23:11:22 +0000 | [diff] [blame] | 47 | |
| 48 | namespace Aliased { extern int a; } |
| 49 | namespace Alias = Aliased; |
Richard Smith | f81c2cc | 2015-02-27 01:57:00 +0000 | [diff] [blame] | 50 | |
| 51 | struct InhCtorA { InhCtorA(int); }; |
| 52 | struct InhCtorB : InhCtorA { using InhCtorA::InhCtorA; }; |
Richard Smith | 9c4fb0a | 2016-04-14 18:32:54 +0000 | [diff] [blame] | 53 | |
| 54 | struct ClassWithVBases : HasFriends, virtual HasNontrivialDefaultConstructor { |
| 55 | int n; |
| 56 | }; |
| 57 | struct ClassWithVBases; |