| 1 |
// PR lto/92609 |
| 2 |
// { dg-lto-do link } |
| 3 |
// { dg-lto-options { { -fPIC -flto } } } |
| 4 |
// { dg-require-effective-target shared } |
| 5 |
// { dg-require-effective-target fpic } |
| 6 |
// { dg-extra-ld-options "-shared" } |
| 7 |
|
| 8 |
namespace std { |
| 9 |
inline namespace __cxx11 {} |
| 10 |
template < typename _Default > struct __detector { using type = _Default; }; |
| 11 |
template < typename _Default, template < typename > class > |
| 12 |
using __detected_or = __detector< _Default >; |
| 13 |
template < typename _Default, template < typename > class _Op > |
| 14 |
using __detected_or_t = typename __detected_or< _Default, _Op >::type; |
| 15 |
template < typename > class allocator; |
| 16 |
template < class > struct char_traits; |
| 17 |
namespace __cxx11 { |
| 18 |
template < typename _CharT, typename = char_traits< _CharT >, |
| 19 |
typename = allocator< _CharT > > |
| 20 |
class basic_string; |
| 21 |
} |
| 22 |
struct __allocator_traits_base { |
| 23 |
template < typename _Tp > using __pointer = typename _Tp::pointer; |
| 24 |
}; |
| 25 |
struct allocator_traits : __allocator_traits_base { |
| 26 |
using pointer = __detected_or_t< char *, __pointer >; |
| 27 |
}; |
| 28 |
} // std |
| 29 |
struct rebind { |
| 30 |
typedef std::allocator_traits other; |
| 31 |
}; |
| 32 |
namespace std { |
| 33 |
namespace __cxx11 { |
| 34 |
template < typename, typename, typename > class basic_string { |
| 35 |
struct _Alloc_hider { |
| 36 |
rebind::other::pointer _M_p; |
| 37 |
} _M_dataplus; |
| 38 |
unsigned long _M_string_length; |
| 39 |
enum { _S_local_capacity = 15 }; |
| 40 |
union { |
| 41 |
char _M_local_buf[_S_local_capacity + 1]; |
| 42 |
unsigned long _M_allocated_capacity; |
| 43 |
}; |
| 44 |
}; |
| 45 |
} // __cxx11 |
| 46 |
template < typename _Tp > class __uniq_ptr_impl { |
| 47 |
template < typename _Up > struct _Ptr { using type = _Up *; }; |
| 48 |
|
| 49 |
public: |
| 50 |
using pointer = typename _Ptr< _Tp >::type; |
| 51 |
}; |
| 52 |
template < typename _Tp > class unique_ptr { |
| 53 |
public: |
| 54 |
using pointer = typename __uniq_ptr_impl< _Tp >::pointer; |
| 55 |
unique_ptr(pointer); |
| 56 |
}; |
| 57 |
} // std |
| 58 |
class wxRefCounter; |
| 59 |
class wxObject { |
| 60 |
virtual wxRefCounter CreateRefData(); |
| 61 |
wxRefCounter *m_refData; |
| 62 |
}; |
| 63 |
class wxGDIObject : wxObject {}; |
| 64 |
class wxFontBase : wxGDIObject {}; |
| 65 |
class wxFont : wxFontBase {}; |
| 66 |
class VisualTool { |
| 67 |
protected: |
| 68 |
VisualTool(int *, int *); |
| 69 |
}; |
| 70 |
class OpenGLText; |
| 71 |
class VisualToolCross : VisualTool { |
| 72 |
std::unique_ptr< OpenGLText > gl_text; |
| 73 |
VisualToolCross(); |
| 74 |
}; |
| 75 |
class OpenGLText { // { dg-lto-warning "7: type 'struct OpenGLText' violates the C\\+\\+ One Definition Rule" } |
| 76 |
float r, g, b, a; |
| 77 |
int fontSize; |
| 78 |
bool fontBold; |
| 79 |
bool fontItalics; |
| 80 |
std::basic_string< char > fontFace; |
| 81 |
wxFont font; |
| 82 |
int glyphs; |
| 83 |
}; |
| 84 |
int VisualToolCross_parent; |
| 85 |
int VisualToolCross_context; |
| 86 |
VisualToolCross::VisualToolCross() |
| 87 |
: VisualTool(&VisualToolCross_parent, &VisualToolCross_context), |
| 88 |
gl_text(0) {} |