This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51385] Unnecessary instantiation converting to pointer to template class instance
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Dec 2011 10:47:45 +0000
- Subject: [Bug c++/51385] Unnecessary instantiation converting to pointer to template class instance
- Auto-submitted: auto-generated
- References: <bug-51385-4@http.gcc.gnu.org/bugzilla/>
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.