3 // Intended to exercise all syntactic parts of the C++ language that
11 using namespace std::debug;
14 namespace safestl = ::std::debug;
21 class Derived1 : Base1, virtual public Base2 { };
23 /* Template classes, template functions */
25 template <E1 v> class C1 {};
26 template <E1 v> C1<v> f1() { return C1<v>(); }
27 void f2() { f1<EC1>(); }
29 // Friend declarations
30 struct FriendlyStruct {
31 friend bool operator==(FriendlyStruct, FriendlyStruct) { return true; }
32 friend struct FriendedStruct;
35 struct FriendedStruct { };
48 // Template specialization declarations
49 template<typename T> class ClassTemplateSpecialization;
52 class ClassTemplateSpecialization<bool> { };
54 template<typename T, bool> struct ClassTemplatePartialSpecialization;
57 struct ClassTemplatePartialSpecialization<T, true> { };
65 template <typename T> T varTemplate = 0;
67 static_assert(true, "");
70 template<typename T> concept True = true;
71 template<typename T> concept Concept = requires (T a) {
73 { a() } noexcept -> True;
74 requires false || true;
77 template<typename T> void constrained1() requires Concept<T>;
78 template<Concept T> void constrained2();
79 void constrained3(Concept auto x);