Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp0x/initlist6.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// Test for initlist lifetime // { dg-do run { target c++11 } } #include <initializer_list> int c; struct A { A(int,int) { ++c; } ~A() { --c; } }; void f (std::initializer_list<A> l) { } int main() { f({ {1,2}, {3,4} }); if (c != 0) return 1; { std::initializer_list<A> l { {1,2}, {3,4} }; if (c != 2) return 2; } if (c != 0) return 3; }