Language
C++
Compiler
gcc HEAD 11.0.0 20201116 (experimental)
Options
Warnings
Boost 1.73.0
C++2a
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=c++2a In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/concepts:44,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/type_traits: In instantiation of 'struct std::is_nothrow_destructible<Foo>':
/opt/wandbox/gcc-head/include/c++/11.0.0/type_traits:3166:35: required from 'constexpr const bool std::is_nothrow_destructible_v<Foo>'
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts:134:28: required by substitution of 'template<class T> requires default_initializable<T> struct Singleton [with T = Foo]'
prog.cc:10:32: required from here
/opt/wandbox/gcc-head/include/c++/11.0.0/type_traits:900:52: error: static assertion failed: template argument must be a complete class or an unbounded array
900 | static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/type_traits:900:52: note: 'std::__is_complete_or_unbounded<std::__type_identity<Foo> >((std::__type_identity<Foo>{}, std::__type_identity<Foo>()))' evaluates to false
prog.cc:10:32: error: template constraint failure for 'template<class T> requires default_initializable<T> struct Singleton'
10 | class Foo: public Singleton<Foo> {};
| ^
prog.cc:10:32: note: constraints not satisfied
In file included from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts: In substitution of 'template<class T> requires default_initializable<T> struct Singleton [with T = Foo]':
prog.cc:10:32: required from here
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts:134:13: required for the satisfaction of 'destructible<_Tp>' [with _Tp = Foo]
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts:138:13: required for the satisfaction of 'constructible_from<_Tp>' [with _Tp = Foo]
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts:143:13: required for the satisfaction of 'default_initializable<T>' [with T = Foo]
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts:134:28: note: the expression 'is_nothrow_destructible_v<_Tp> [with _Tp = Foo]' evaluated to 'false'
134 | concept destructible = is_nothrow_destructible_v<_Tp>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exit Code:
1