1 class HasFriends { 2 friend void friend_1(HasFriends); 3 friend void friend_2(HasFriends); 4 void private_thing(); 5 }; 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), ""); 21 22 void *operator new[](__SIZE_TYPE__); 23 24 extern int mergeUsedFlag; 25 inline int getMergeUsedFlag() { return mergeUsedFlag; } 26 27 typedef struct { 28 int n; 29 int m; 30 } NameForLinkage; 31 32 struct HasVirtualFunctions { 33 virtual void f(); 34 }; 35 struct OverridesVirtualFunctions : HasVirtualFunctions { 36 void f(); 37 }; 38 extern "C" void ExternCFunction(); 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; 47 48 namespace Aliased { extern int a; } 49 namespace Alias = Aliased; 50 51 struct InhCtorA { InhCtorA(int); }; 52 struct InhCtorB : InhCtorA { using InhCtorA::InhCtorA; }; 53