re PR c++/66743 (ICE: tree check: expected record_type or union_type or qual_union_ty...
authorJason Merrill <jason@redhat.com>
Fri, 3 Jul 2015 00:45:34 +0000 (20:45 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 3 Jul 2015 00:45:34 +0000 (20:45 -0400)
PR c++/66743
* pt.c (for_each_template_parm_r) [UNDERLYING_TYPE]: Use
TYPE_VALUES_RAW rather than TYPE_FIELDS.

From-SVN: r225365

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/alias-decl-51.C [new file with mode: 0644]

index 12640af60a1d45ebcb45674c3affd12bf87be304..c72954dd82ea1dc27153643076892553e584f5fb 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-02  Jason Merrill  <jason@redhat.com>
+
+       PR c++/66743
+       * pt.c (for_each_template_parm_r) [UNDERLYING_TYPE]: Use
+       TYPE_VALUES_RAW rather than TYPE_FIELDS.
+
 2015-07-02  Andrew Sutton  <andrew.n.sutton@gmail.com>
 
        * pt.c (type_dependent_expression_p): Handle expressions
index 12feeee3f547babb801edf50b2e7c1657bb69eba..e819b69ede35a02ffb4a72cde1f746ff3e46fe75 100644 (file)
@@ -8255,7 +8255,7 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, void *d)
     case TYPEOF_TYPE:
     case UNDERLYING_TYPE:
       if (pfd->include_nondeduced_p
-         && for_each_template_parm (TYPE_FIELDS (t), fn, data,
+         && for_each_template_parm (TYPE_VALUES_RAW (t), fn, data,
                                     pfd->visited, 
                                     pfd->include_nondeduced_p))
        return error_mark_node;
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-51.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-51.C
new file mode 100644 (file)
index 0000000..cef3715
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/66743
+// { dg-do compile { target c++11 } }
+
+template< class T >
+struct
+  type_is { using type = T; };
+
+template< class T >
+  using underlying_type = type_is<__underlying_type(T)>;