pt.c (retrieve_specialization): Make sure our arguments have gone through strip_typedefs.
authorJason Merrill <jason@redhat.com>
Mon, 18 May 2015 18:08:53 +0000 (14:08 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 18 May 2015 18:08:53 +0000 (14:08 -0400)
* pt.c (retrieve_specialization): Make sure our arguments have
gone through strip_typedefs.

From-SVN: r223305

gcc/cp/ChangeLog
gcc/cp/pt.c

index 04576e5a8a0b88d156f380e4f1ac4173ea18debe..b21e6a07974d611b514501e775a4bb7b85f4ddf3 100644 (file)
@@ -1,5 +1,8 @@
 2015-05-18  Jason Merrill  <jason@redhat.com>
 
+       * pt.c (retrieve_specialization): Make sure our arguments have
+       gone through strip_typedefs.
+
        * pt.c (tsubst_decl) [VAR_DECL]: Call coerce_innermost_template_parms.
        (determine_specialization): Call coerce_template_parms.
 
index 2166f5fb65ea99a2585f6fa74cf2a64cfd6853c9..60f395893aea8cbdde454b3160d1ba08e6944ec1 100644 (file)
@@ -1058,6 +1058,14 @@ retrieve_specialization (tree tmpl, tree args, hashval_t hash)
                  ? TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl))
                  : template_class_depth (DECL_CONTEXT (tmpl))));
 
+#ifdef ENABLE_CHECKING
+  /* We should have gone through coerce_template_parms by now.  */
+  ++processing_template_decl;
+  if (!any_dependent_template_arguments_p (args))
+    gcc_assert (strip_typedefs_expr (args, NULL) == args);
+  --processing_template_decl;
+#endif
+
   if (optimize_specialization_lookup_p (tmpl))
     {
       tree class_template;