https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88419
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Fri Mar 8 21:40:15 2019 New Revision: 269512 URL: https://gcc.gnu.org/viewcvs?rev=269512&root=gcc&view=rev Log: PR c++/88419 - C++17 ICE with class template arg deduction. Just like in make_constrained_auto, we need to defer setting TYPE_CANONICAL until we've set fields that will affect structural_comptypes. * pt.c (make_template_placeholder): Set TYPE_CANONICAL after CLASS_PLACEHOLDER_TEMPLATE. Added: branches/gcc-8-branch/gcc/testsuite/g++.dg/cpp1z/class-deduction62.C Modified: branches/gcc-8-branch/gcc/cp/ChangeLog branches/gcc-8-branch/gcc/cp/pt.c