view gcc/testsuite/g++.dg/cpp2a/concepts-template-parm2.C @ 152:2b5abeee2509

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

// { dg-do compile { target c++2a } }

template<typename T>
  concept Int = __is_same_as(T, int);

template<typename> struct Foo;

// Instantiation of default arguments happens at the point of
// instantiation for the class.

template<Int T = char> struct S1 { };
template<Int auto X = false> struct S2 { };

S1<> s1; // { dg-error "constraint failure" }
S2<> s2; // { dg-error "placeholder constraints not satisfied" }