[PR90916] Use TI accessor.
authorNathan Sidwell <nathans@fb.com>
Tue, 14 Jan 2020 21:08:14 +0000 (13:08 -0800)
committerNathan Sidwell <nathans@fb.com>
Tue, 14 Jan 2020 21:08:14 +0000 (13:08 -0800)
PR c++/90916
* pt.c (retrieve_specialization): Use get_template_info, not open
coding access.

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

index c13753985173c8aefb5162fe89546acef500ea70..59e0994c397e53fe243f06261b24193024fcbd45 100644 (file)
@@ -1,5 +1,9 @@
 2020-01-14  Nathan Sidwell  <nathan@acm.org>
 
+       PT c++/90916
+       * pt.c (retrieve_specialization): Use get_template_info, not open
+       coding access.
+
        PR c++/90916
        * pt.c (retrieve_specialization): Get the TI from the decl or the
        classtype as appropriate.
index 7e675ce9039f5e564a7b3632fcd8b885656e91ee..9bb8cc13e5f49630e964ea36b56030b4a0acf9db 100644 (file)
@@ -1252,9 +1252,7 @@ retrieve_specialization (tree tmpl, tree args, hashval_t hash)
       for (ovl_iterator iter (fns); iter; ++iter)
        {
          tree fn = *iter;
-         if (tree ti = (TREE_CODE (fn) == TYPE_DECL && !TYPE_DECL_ALIAS_P (fn)
-                        ? TYPE_TEMPLATE_INFO (TREE_TYPE (fn))
-                        : DECL_TEMPLATE_INFO (fn)))
+         if (tree ti = get_template_info (fn))
            if (TI_TEMPLATE (ti) == tmpl
                /* using-declarations can bring in a different
                   instantiation of tmpl as a member of a different