Debian Codegraph @

gcc/testsuite/g++.dg/DRs/dr2137-1.C

raw
1 // DR 2137
2 // { dg-do run { target c++11 } }
3
4 // Test that an initializer_list constructor beats the copy constructor.
5
6 #include <initializer_list>
7
8 bool ok = false;
9
10 struct Q {
11 Q() = default;
12 Q(Q const&) = default;
13 Q(Q&&) = default;
14 Q(std::initializer_list<Q>) { ok = true; }
15 };
16
17 int main() {
18 Q x = Q { Q() };
19 if (!ok) __builtin_abort ();
20 }