https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87012
--- Comment #5 from Alexandre Oliva <aoliva at gcc dot gnu.org> --- Author: aoliva Date: Wed Dec 19 06:51:30 2018 New Revision: 267251 URL: https://gcc.gnu.org/viewcvs?rev=267251&root=gcc&view=rev Log: [PR87012] canonicalize ref type for tmpl arg When binding an object to a template parameter of reference type, we take the address of the object and dereference that address. The type of the address may still carry (template) typedefs, but verify_unstripped_args_1 rejects such typedefs other than in the top level of template arguments. Canonicalizing the type we want to convert to right after any substitutions or deductions avoids that issue. for gcc/cp/ChangeLog PR c++/87012 * pt.c (convert_template_argument): Canonicalize type after tsubst/deduce. for gcc/testsuite/ChangeLog PR c++/87012 * g++.dg/cpp0x/pr87012.C: New. Added: trunk/gcc/testsuite/g++.dg/cpp0x/pr87012.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog