| 1 |
// PR c++/38380 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
namespace std |
| 5 |
{ |
| 6 |
struct atomic_bool |
| 7 |
{ |
| 8 |
bool _M_i; |
| 9 |
|
| 10 |
atomic_bool() = default; |
| 11 |
~atomic_bool() = default; |
| 12 |
atomic_bool(const atomic_bool&) = delete; |
| 13 |
atomic_bool& operator=(const atomic_bool&) = delete; |
| 14 |
|
| 15 |
explicit atomic_bool(bool __i) { _M_i = __i; } |
| 16 |
|
| 17 |
operator bool() const volatile |
| 18 |
{ return true; } |
| 19 |
}; |
| 20 |
} |
| 21 |
|
| 22 |
namespace __gnu_test |
| 23 |
{ |
| 24 |
struct direct_list_initializable |
| 25 |
{ |
| 26 |
template<typename _Ttype, typename _Tvalue> |
| 27 |
void |
| 28 |
operator()() |
| 29 |
{ |
| 30 |
struct _Concept |
| 31 |
{ |
| 32 |
void __constraint() |
| 33 |
{ |
| 34 |
_Ttype __v1 = { }; // default ctor |
| 35 |
_Ttype __v2 { __a }; // single-argument ctor |
| 36 |
} |
| 37 |
|
| 38 |
_Tvalue __a; |
| 39 |
}; |
| 40 |
|
| 41 |
void (_Concept::*__x)() __attribute__((unused)) |
| 42 |
= &_Concept::__constraint; |
| 43 |
} |
| 44 |
}; |
| 45 |
} |
| 46 |
|
| 47 |
int main() |
| 48 |
{ |
| 49 |
__gnu_test::direct_list_initializable test; |
| 50 |
|
| 51 |
test.operator()<std::atomic_bool, bool>(); |
| 52 |
return 0; |
| 53 |
} |