<div dir="ltr"><div>Hello cfe-dev group,</div><div><br></div><div>Consider this template metaprogram:</div><div>template <unsigned N> struct fib { enum { value = fib<N-1>::value + fib<N-2>::value}; };<br></div>template <> struct fib<1> { enum { value = 1 }; };<br>template <> struct fib<0> { enum { value = 0 }; };<div><br></div><div>During compilation of 'fib<2>::value' (after finally getting memoized result of instantiation of struct fib<0>) Clang «instantiates the anonymous enum inside fib<0> and fib<1>» 129 times in sum. In case, when we use 'constexpr static auto' instead of 'enum', no additional instantiations occurs. Why Clang performs additional instantiations in the first case?</div><div><br></div><div>Thank you,</div><div>Pavel</div></div>