2013-08-30 08:23:29 +08:00
|
|
|
class HasFriends {
|
|
|
|
friend void friend_1(HasFriends);
|
|
|
|
friend void friend_2(HasFriends);
|
|
|
|
void private_thing();
|
|
|
|
};
|
2014-04-18 04:33:01 +08:00
|
|
|
|
|
|
|
struct HasNontrivialDefaultConstructor {
|
|
|
|
HasNontrivialDefaultConstructor() = default;
|
|
|
|
HasNontrivialDefaultConstructor(int n = 0);
|
|
|
|
|
|
|
|
// Ensure this class is not POD but is still trivially-copyable.
|
|
|
|
// This is necessary to exercise the second static_assert below,
|
|
|
|
// because GCC's spec for __has_trivial_constructor is absurd.
|
|
|
|
int m;
|
|
|
|
private:
|
|
|
|
int n;
|
|
|
|
};
|
|
|
|
|
|
|
|
static_assert(!__is_trivial(HasNontrivialDefaultConstructor), "");
|
|
|
|
static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), "");
|
2014-05-16 10:14:42 +08:00
|
|
|
|
|
|
|
void *operator new[](__SIZE_TYPE__);
|
2014-06-17 04:26:19 +08:00
|
|
|
|
|
|
|
extern int mergeUsedFlag;
|
|
|
|
inline int getMergeUsedFlag() { return mergeUsedFlag; }
|
2014-08-23 09:45:27 +08:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int n;
|
|
|
|
int m;
|
|
|
|
} NameForLinkage;
|
2014-08-27 07:29:11 +08:00
|
|
|
|
|
|
|
struct HasVirtualFunctions {
|
|
|
|
virtual void f();
|
|
|
|
};
|
|
|
|
struct OverridesVirtualFunctions : HasVirtualFunctions {
|
|
|
|
void f();
|
|
|
|
};
|
2014-08-30 06:33:38 +08:00
|
|
|
extern "C" void ExternCFunction();
|
2014-08-30 08:04:23 +08:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
struct Inner {
|
|
|
|
int n;
|
|
|
|
};
|
|
|
|
} NameForLinkage2;
|
|
|
|
auto name_for_linkage2_inner_a = NameForLinkage2::Inner();
|
|
|
|
typedef decltype(name_for_linkage2_inner_a) NameForLinkage2Inner;
|
2014-09-04 07:11:22 +08:00
|
|
|
|
|
|
|
namespace Aliased { extern int a; }
|
|
|
|
namespace Alias = Aliased;
|
2015-02-27 09:57:00 +08:00
|
|
|
|
|
|
|
struct InhCtorA { InhCtorA(int); };
|
|
|
|
struct InhCtorB : InhCtorA { using InhCtorA::InhCtorA; };
|