1*7862728cSRaphael Isemann struct ContextClass { 2*7862728cSRaphael Isemann int member = 3; 3*7862728cSRaphael Isemann ContextClass *this_type = nullptr; ContextClassContextClass4*7862728cSRaphael Isemann ContextClass() { this_type = this; } 5*7862728cSRaphael Isemann funcContextClass6*7862728cSRaphael Isemann int func() const { 7*7862728cSRaphael Isemann return member; // break in function in class. 8*7862728cSRaphael Isemann } 9*7862728cSRaphael Isemann templateFuncContextClass10*7862728cSRaphael Isemann template <class T> T templateFunc(T x) const { 11*7862728cSRaphael Isemann return member; // break in templated function in class. 1299451b44SJordan Rupprecht } 1399451b44SJordan Rupprecht }; 1499451b44SJordan Rupprecht 15*7862728cSRaphael Isemann template <typename TC> struct TemplatedContextClass { 16*7862728cSRaphael Isemann int member = 4; 17*7862728cSRaphael Isemann TemplatedContextClass<TC> *this_type = nullptr; TemplatedContextClassTemplatedContextClass18*7862728cSRaphael Isemann TemplatedContextClass() { this_type = this; } 19*7862728cSRaphael Isemann funcTemplatedContextClass20*7862728cSRaphael Isemann int func() const { 21*7862728cSRaphael Isemann return member; // break in function in templated class. 22*7862728cSRaphael Isemann } 23*7862728cSRaphael Isemann templateFuncTemplatedContextClass24*7862728cSRaphael Isemann template <class T> T templateFunc(T x) const { 25*7862728cSRaphael Isemann return member; // break in templated function in templated class. 26*7862728cSRaphael Isemann } 27*7862728cSRaphael Isemann }; 2899451b44SJordan Rupprecht main()2999451b44SJordan Rupprechtint main() { 30*7862728cSRaphael Isemann ContextClass c; 31*7862728cSRaphael Isemann TemplatedContextClass<int> t; 32*7862728cSRaphael Isemann return c.func() + c.templateFunc(1) + t.func() + t.templateFunc(1); 3399451b44SJordan Rupprecht } 34