pt.c (dependent_type_p): Make sure we aren't called with global_type_node.
authorJason Merrill <jason@redhat.com>
Wed, 10 May 2017 16:32:13 +0000 (12:32 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 10 May 2017 16:32:13 +0000 (12:32 -0400)
* pt.c (dependent_type_p): Make sure we aren't called with
global_type_node.

From-SVN: r247843

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

index 45ef8d3904c52f538b4ebe6b9f04f8b19ffb540f..09caa02ba70b19cdbd9dc091889975019c8c2281 100644 (file)
@@ -1,5 +1,8 @@
 2017-05-10  Jason Merrill  <jason@redhat.com>
 
+       * pt.c (dependent_type_p): Make sure we aren't called with
+       global_type_node.
+
        PR c++/79549 - C++17 ICE with non-type auto template parameter pack
        * pt.c (convert_template_argument): Just return an argument pack.
        (coerce_template_parameter_pack, template_parm_to_arg)
index 72256b3bd25db6d87f2f4f5036540d19a8a13d86..b9e7af7066b40c0ff29c2401d8b355481c6c6a3f 100644 (file)
@@ -23436,6 +23436,10 @@ dependent_type_p (tree type)
   if (type == error_mark_node)
     return false;
 
+  /* Getting here with global_type_node means we improperly called this
+     function on the TREE_TYPE of an IDENTIFIER_NODE.  */
+  gcc_checking_assert (type != global_type_node);
+
   /* If we have not already computed the appropriate value for TYPE,
      do so now.  */
   if (!TYPE_DEPENDENT_P_VALID (type))