C++ Undefined Behavior Infinite template recursion


Example

Example from the Standard, [temp.inst]/17:

template<class T> class X {
    X<T>* p; // OK
    X<T*> a; // implicit generation of X<T> requires
             // the implicit instantiation of X<T*> which requires
             // the implicit instantiation of X<T**> which ...
};