[Bug c++/51385] Unnecessary instantiation converting to pointer to template class instance
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51385 --- Comment #5 from paolo at gcc dot gnu.org --- Author: paolo Date: Mon Sep 29 09:06:31 2014 New Revision: 215680 URL: https://gcc.gnu.org/viewcvs?rev=215680&root=gcc&view=rev Log: 2014-09-29 Paolo Carlini PR c++/51385 * g++.dg/template/pr51385.C: New. Added: trunk/gcc/testsuite/g++.dg/template/pr51385.C Modified: trunk/gcc/testsuite/ChangeLog
[Bug c++/51385] Unnecessary instantiation converting to pointer to template class instance
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51385 Paolo Carlini changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED Target Milestone|--- |4.9.0 --- Comment #6 from Paolo Carlini --- Done.
[Bug c++/51385] Unnecessary instantiation converting to pointer to template class instance
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51385 --- Comment #4 from Paolo Carlini --- This is fixed in 4.9.0, I'm adding the testcase and closing the bug.
[Bug c++/51385] Unnecessary instantiation converting to pointer to template class instance
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51385 --- Comment #3 from Jonathan Wakely 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 struct FussyTemplate #ifndef INCOMPLETE { static_assert( test::value, "not short" ); } #endif ; But if the class template definition is available it gets instantiated.
[Bug c++/51385] Unnecessary instantiation converting to pointer to template class instance
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51385 Paolo Carlini changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2011-12-02 CC||jason at gcc dot gnu.org Ever Confirmed|0 |1 --- Comment #2 from Paolo Carlini 2011-12-02 10:42:28 UTC --- Let's add Jason in CC, definitely not a regression, but the issue seems pretty interesting, eh.
[Bug c++/51385] Unnecessary instantiation converting to pointer to template class instance
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51385 --- Comment #1 from Jonathan Wakely 2011-12-02 10:36:14 UTC --- Here's a version which isn't a compile-time-hog but demonstrates the unnecessary instantiation with a static_assert (so needs -std=c++11) template struct NTmpl; template > struct PtrConvs { enum { bad = 1 }; }; template struct PtrConvs >; template struct test { static const bool value = true; }; template<> struct test { static const bool value = false; }; template struct FussyTemplate { static_assert( test::value, "not short" ); }; struct B { }; typedef char chk[1]; typedef char chk[PtrConvs, B>::bad]; EFG and Clang compile this happily, without instantiating FussyTemplate