[Bug c++/17410] selects general template instead of valid specialization with nested template

giovannibajo at libero dot it gcc-bugzilla@gcc.gnu.org
Sat Sep 11 01:51:00 GMT 2004


------- Additional Comments From giovannibajo at libero dot it  2004-09-11 01:51 -------
This is weird. Redux:

-------------------------------------------------------
template <class>
struct Outer {
  template <class> struct Inner {};
}; 

template <class T>
struct A;

template <template <class> class Q, class P>
struct A <Q<P> > {};

template <class T> struct UNRELATED;
template <class T> struct UNRELATED<Outer<void>::Inner<T*> >;

template struct A<Outer<void>::Inner<int*> >;
-------------------------------------------------------

This should be accepted, because the specialization of A should be matched
(with Q = "Outer<void>::Inner", and P = "int*" of course). Instead, it does 
not, *unless* you comment the UNRELATED template.

Looks like something gets alterated in the tsubst process. Not a regression, 
though (the original code manages to be rejected everywhere, while the redux 
even ICEs older compilers).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|./configure --              |
                   |prefix=/usr/local/gcc-3.4.1 |
                   |--enable-languages=c++      |
   GCC host triplet|Linux null.localdomain.fake |
                   |2.4.18-bf2.4 #1 Son Apr 14  |
                   |09:53:28                    |
           Keywords|                            |accepts-invalid, rejects-
                   |                            |valid, wrong-code
      Known to fail|                            |2.95.3 3.0.4 3.2.3 3.3.3
                   |                            |3.4.0 4.0.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-11 01:51:22
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17410



More information about the Gcc-bugs mailing list