aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/DRs/dr2137-1.C
blob: ad6b5325a1e72884637588b106669edc2c301f91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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 ();
}