| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-fgnu-tm -O0" } |
| 3 |
|
| 4 |
namespace std { |
| 5 |
template<typename _CharT> struct char_traits; |
| 6 |
|
| 7 |
template<typename _Tp> class allocator { |
| 8 |
}; |
| 9 |
|
| 10 |
template<typename _Tp> struct less { |
| 11 |
bool operator()(const _Tp& __x, const _Tp& __y) const { |
| 12 |
return __x < __y; |
| 13 |
} |
| 14 |
}; |
| 15 |
|
| 16 |
template <typename _Key, typename _Compare = std::less<_Key> > class map { |
| 17 |
public: |
| 18 |
_Compare _M_key_compare; |
| 19 |
bool find(const _Key& __x) { |
| 20 |
return _M_key_compare(__x, __x); |
| 21 |
} |
| 22 |
}; |
| 23 |
|
| 24 |
template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_string { |
| 25 |
public: |
| 26 |
bool compare(const basic_string& __str) const { |
| 27 |
return 0; |
| 28 |
} |
| 29 |
void key (); |
| 30 |
}; |
| 31 |
|
| 32 |
typedef basic_string<char> string; |
| 33 |
|
| 34 |
template<typename _CharT, typename _Traits> |
| 35 |
inline bool operator<(const basic_string<_CharT, _Traits>& __lhs, const basic_string<_CharT, _Traits>& __rhs) { |
| 36 |
return __lhs.compare(__rhs); |
| 37 |
} |
| 38 |
|
| 39 |
template class basic_string<char>; |
| 40 |
|
| 41 |
} |
| 42 |
|
| 43 |
std::map<std::string> units; |
| 44 |
|
| 45 |
__attribute__((transaction_callable)) |
| 46 |
void get(const std::string &name) { |
| 47 |
units.find(name); |
| 48 |
} |
| 49 |
|
| 50 |
// { dg-final { scan-assembler "_ZGTtNKSs7compareERKSs:" } } |