Today, I encountered a compile issue in clang that surprised me. I guess is reasonable but I like to dig deeper and hear more details. Some standard references if possible also.
Yes, this compiles in MSVC because it has a well-known bug. It doesn't implement two-step template instantiation.
To elaborate. MSVC wrongly defers template parsing until it is actually instantiated in the code. Likely it happens after full Page
definition becomes visible.
However, standard demands that the template is pre-parsed at the point of definition, and all types which are not dependent on template arguments are resolved. This fails, since m_page
is not dependent on visitor argument - and it is still incomplete type at this point.
P.S. I can't even express how outraged I am at MSFT for this blatant Standard violation (among others). It makes cross-platform development a real pain, when MS-compliant code has to be ported to conforming compilers.