1f4a2713aSLionel Sambuc class HasFriends { 2f4a2713aSLionel Sambuc friend void friend_1(HasFriends); 3f4a2713aSLionel Sambuc friend void friend_2(HasFriends); 4f4a2713aSLionel Sambuc void private_thing(); 5f4a2713aSLionel Sambuc }; 6*0a6a1f1dSLionel Sambuc 7*0a6a1f1dSLionel Sambuc struct HasNontrivialDefaultConstructor { 8*0a6a1f1dSLionel Sambuc HasNontrivialDefaultConstructor() = default; 9*0a6a1f1dSLionel Sambuc HasNontrivialDefaultConstructor(int n = 0); 10*0a6a1f1dSLionel Sambuc 11*0a6a1f1dSLionel Sambuc // Ensure this class is not POD but is still trivially-copyable. 12*0a6a1f1dSLionel Sambuc // This is necessary to exercise the second static_assert below, 13*0a6a1f1dSLionel Sambuc // because GCC's spec for __has_trivial_constructor is absurd. 14*0a6a1f1dSLionel Sambuc int m; 15*0a6a1f1dSLionel Sambuc private: 16*0a6a1f1dSLionel Sambuc int n; 17*0a6a1f1dSLionel Sambuc }; 18*0a6a1f1dSLionel Sambuc 19*0a6a1f1dSLionel Sambuc static_assert(!__is_trivial(HasNontrivialDefaultConstructor), ""); 20*0a6a1f1dSLionel Sambuc static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), ""); 21*0a6a1f1dSLionel Sambuc 22*0a6a1f1dSLionel Sambuc void *operator new[](__SIZE_TYPE__); 23*0a6a1f1dSLionel Sambuc 24*0a6a1f1dSLionel Sambuc extern int mergeUsedFlag; getMergeUsedFlag()25*0a6a1f1dSLionel Sambucinline int getMergeUsedFlag() { return mergeUsedFlag; } 26*0a6a1f1dSLionel Sambuc 27*0a6a1f1dSLionel Sambuc typedef struct { 28*0a6a1f1dSLionel Sambuc int n; 29*0a6a1f1dSLionel Sambuc int m; 30*0a6a1f1dSLionel Sambuc } NameForLinkage; 31*0a6a1f1dSLionel Sambuc 32*0a6a1f1dSLionel Sambuc struct HasVirtualFunctions { 33*0a6a1f1dSLionel Sambuc virtual void f(); 34*0a6a1f1dSLionel Sambuc }; 35*0a6a1f1dSLionel Sambuc struct OverridesVirtualFunctions : HasVirtualFunctions { 36*0a6a1f1dSLionel Sambuc void f(); 37*0a6a1f1dSLionel Sambuc }; 38*0a6a1f1dSLionel Sambuc extern "C" void ExternCFunction(); 39*0a6a1f1dSLionel Sambuc 40*0a6a1f1dSLionel Sambuc typedef struct { 41*0a6a1f1dSLionel Sambuc struct Inner { 42*0a6a1f1dSLionel Sambuc int n; 43*0a6a1f1dSLionel Sambuc }; 44*0a6a1f1dSLionel Sambuc } NameForLinkage2; 45*0a6a1f1dSLionel Sambuc auto name_for_linkage2_inner_a = NameForLinkage2::Inner(); 46*0a6a1f1dSLionel Sambuc typedef decltype(name_for_linkage2_inner_a) NameForLinkage2Inner; 47*0a6a1f1dSLionel Sambuc 48*0a6a1f1dSLionel Sambuc namespace Aliased { extern int a; } 49*0a6a1f1dSLionel Sambuc namespace Alias = Aliased; 50