Richard Smith | d28ac5b | 2014-03-22 23:33:22 +0000 | [diff] [blame] | 1 | template<typename T> struct S { |
| 2 | __attribute__((always_inline)) static int f() { return 0; } |
| 3 | __attribute__((always_inline, visibility("hidden"))) static int g() { return 0; } |
| 4 | }; |
| 5 | |
| 6 | extern template struct S<int>; |
Richard Smith | 04d05b5 | 2014-03-23 00:27:18 +0000 | [diff] [blame] | 7 | |
| 8 | template<typename T> T min(T a, T b) { return a < b ? a : b; } |
| 9 | |
| 10 | extern decltype(min(1, 2)) instantiate_min_decl; |
Richard Smith | cd45dbc | 2014-04-19 03:48:30 +0000 | [diff] [blame] | 11 | |
| 12 | template<typename T> struct CtorInit { |
| 13 | static int f() { return 0; } |
| 14 | int a; |
| 15 | CtorInit() : a(f()) {} |
| 16 | }; |
Richard Smith | 6de7a24 | 2014-07-31 23:46:44 +0000 | [diff] [blame] | 17 | |
| 18 | namespace ImplicitSpecialMembers { |
| 19 | struct A { |
| 20 | A(const A&); |
| 21 | }; |
| 22 | struct B { |
| 23 | A a; |
| 24 | B(int); |
| 25 | }; |
| 26 | struct C { |
| 27 | A a; |
| 28 | C(int); |
| 29 | }; |
| 30 | struct D { |
| 31 | A a; |
| 32 | D(int); |
| 33 | }; |
| 34 | } |
Richard Smith | 4d23579 | 2014-08-07 18:53:08 +0000 | [diff] [blame] | 35 | |
| 36 | namespace OperatorDeleteLookup { |
| 37 | struct A { void operator delete(void*); virtual ~A() = default; }; |
| 38 | template<typename T> struct B { void operator delete(void*); virtual ~B() {} typedef int t; }; |
| 39 | typedef B<int>::t b_int_instantated; |
| 40 | } |
Richard Smith | c9cbde7 | 2014-08-13 21:15:09 +0000 | [diff] [blame] | 41 | |
| 42 | namespace EmitInlineMethods { |
| 43 | struct A { |
| 44 | void f() {} |
| 45 | void g(); |
| 46 | }; |
| 47 | struct B { |
| 48 | void f(); |
| 49 | void g() {} |
| 50 | }; |
| 51 | } |