Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/DRs/dr2137-1.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// DR 2137 // { dg-do run { target c++11 } } // Test that an initializer_list constructor beats the copy constructor. #include <initializer_list> bool ok = false; struct Q { Q() = default; Q(Q const&) = default; Q(Q&&) = default; Q(std::initializer_list<Q>) { ok = true; } }; int main() { Q x = Q { Q() }; if (!ok) __builtin_abort (); }