On 11/06/2013 05:56 AM, Paolo Carlini wrote:
in this bug, filed by Zack, we loop forever after error in constant_value_1. Straightforward thing to do, detect and break out.
This doesn't handle mutual infinite recursion, such as the modified testcase below. I think the right answer is to make sure that if we hit an instantiation depth error during instantiation of the initializer of a variable, we set DECL_INITIAL to error_mark_node. Perhaps just checking errorcount is good enough.
template <bool> struct VI {}; template <class T> struct B; template <typename T> struct IP { static const bool r = B<T>::r; }; template <class T> struct B { static const bool r = IP<T>::r; }; template <typename T> struct V { VI<IP<T>::r> vi; }; struct X; struct Y { V<X> v; };