view gcc/testsuite/g++.dg/cpp2a/nontype-class35.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

// PR c++/94592 - ICE with { } as template argument.
// { dg-do compile { target c++20 } }

struct A {
    int i;
    constexpr A(int n) : i(n) {}
};

template <A a> struct B { int i; constexpr B() : i(a.i) { } };

template<typename> void bar () {
    B<{1}> var;
}

void fu() {
    bar<int>();
}