view gcc/testsuite/g++.dg/cpp0x/initlist92.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR c++/64665, DR 1467 
// { dg-do compile { target c++11 } }

#include <string>

bool Test1(bool);
bool Test1(std::string) = delete;

bool Test2(int) = delete;
bool Test2(std::initializer_list<int>);

struct S 
{ 
    S(int _a) : a(_a) {}
private:
    int a;
};
bool Test3(int);
bool Test3(S) = delete;

bool Test4(bool) = delete;
bool Test4(std::initializer_list<std::string>);

int main () 
{
  ( Test1({"false"}) );	// { dg-error "narrowing" "" { target c++2a } }
  ( Test2({123}) );
  ( Test3({456}) );
  ( Test4({"false"}) );
}