view gcc/testsuite/g++.dg/cpp0x/deleted8.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR c++/56633
// { dg-do compile { target c++11 } }

struct A {
  A(int) { }
  A(const A&) = delete;
};

struct Test1 {
    A value2{0}; // no problem here
};

template <typename T> // T is not used
struct Test2 {
    A value2{0}; // fails to compile
};

int main() {
    Test1 test;
    Test2<int> test2;
    return 0;
}