Fixed #4446 (Crash on complex C++ template)