https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83000

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
$ g++ --version
g++ (GCC) 12.0.0 20211208 (experimental)

$ g++ pr83000.C -c -fconcepts
pr83000.C: In function ‘int main()’:
pr83000.C:6:18: error: template constraint failure for ‘template<class T> 
requires  sizeof (T) > 1 union Test’
    6 |         Test<char> x;
      |                  ^
pr83000.C:6:18: note: constraints not satisfied
pr83000.C: In substitution of ‘template<class T>  requires  sizeof (T) > 1
union Test [with T = char]’:
pr83000.C:6:18:   required from here
pr83000.C:3:11:   required by the constraints of ‘template<class T>  requires 
sizeof (T) > 1 union Test’
pr83000.C:2:25: note: the expression ‘sizeof (T) > 1 [with T = char]’ evaluated
to ‘false’
    2 |     requires (sizeof(T) > 1)
      |              ~~~~~~~~~~~^~~~

$ g++ pr83000.C -c -std=c++2a
pr83000.C: In function ‘int main()’:
pr83000.C:6:18: error: template constraint failure for ‘template<class T> 
requires  sizeof (T) > 1 union Test’
    6 |         Test<char> x;
      |                  ^
pr83000.C:6:18: note: constraints not satisfied
pr83000.C: In substitution of ‘template<class T>  requires  sizeof (T) > 1
union Test [with T = char]’:
pr83000.C:6:18:   required from here
pr83000.C:3:11:   required by the constraints of ‘template<class T>  requires 
sizeof (T) > 1 union Test’
pr83000.C:2:25: note: the expression ‘sizeof (T) > 1 [with T = char]’ evaluated
to ‘false’
    2 |     requires (sizeof(T) > 1)
      |              ~~~~~~~~~~~^~~~

Reply via email to