Hi,

this issue seems just another case of:

    http://gcc.gnu.org/ml/gcc-patches/2012-10/msg02472.html

thus we are ICEing because TYPE_STUB_DECL is null and we want to use TYPE_MAIN_DECL.

Tested x86_64-linux.

Thanks,
Paolo.

///////////////////////


/cp
2013-06-07  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/53658
        * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
        not TYPE_STUB_DECL, to access the _DECL for a _TYPE.

/testsuite
2013-06-07  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/53658
        * g++.dg/cpp0x/alias-decl-36.C: New.
Index: cp/pt.c
===================================================================
--- cp/pt.c     (revision 199776)
+++ cp/pt.c     (working copy)
@@ -7561,7 +7561,7 @@ lookup_template_class_1 (tree d1, tree arglist, tr
       if (CLASS_TYPE_P (template_type) && is_dependent_type)
        /* If the type makes use of template parameters, the
           code that generates debugging information will crash.  */
-       DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1;
+       DECL_IGNORED_P (TYPE_MAIN_DECL (t)) = 1;
 
       /* Possibly limit visibility based on template args.  */
       TREE_PUBLIC (type_decl) = 1;
Index: testsuite/g++.dg/cpp0x/alias-decl-36.C
===================================================================
--- testsuite/g++.dg/cpp0x/alias-decl-36.C      (revision 0)
+++ testsuite/g++.dg/cpp0x/alias-decl-36.C      (working copy)
@@ -0,0 +1,6 @@
+// PR c++/53658
+// { dg-do compile { target c++11 } }
+
+struct A;
+template <typename> using Foo = const A;
+template <typename Item> Foo <Item> bar();

Reply via email to