[Bug c++/51385] Unnecessary instantiation converting to pointer to template class instance

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 2 10:48:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51385

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-02 10:47:45 UTC ---
Interestingly G++ is happy to not instantiate the template when it's not
possible to, i.e. making this change and defining -DINCOMPLETE allows it to
compile:

template <typename T>
struct FussyTemplate
#ifndef INCOMPLETE
{
    static_assert( test<T>::value, "not short" );
}
#endif
;

But if the class template definition is available it gets instantiated.



More information about the Gcc-bugs mailing list