This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14284] [3.4/3.5 regression] Failure to select obvious template specialisation


------- Additional Comments From bangerth at dealii dot org  2004-02-25 17:33 -------
OK, this was a little tougher than thought, but it's clear: 
--------------------- 
template<typename> struct S; 
template<typename, template<class> class> struct I {}; 
 
template<class, int> struct Match; 
 
template<typename T, template<class> class C> 
struct Match<I<T,C>, 0> {}; 
 
template<typename T, template<class> class C, int i> 
struct Match<I<T,C>, i> {}; 
 
Match<I<int,S>, 0> v;  
---------------------- 
This should certainly compile: 
 
g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/c++ -c x.cc 
 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc 
x.cc:12: error: ambiguous class template instantiation for `struct 
Match<I<int, S>, 0>' 
x.cc:10: error: candidates are: struct Match<I<T, C>, i> 
x.cc:7: error:                 struct Match<I<T, C>, 0> 
x.cc:12: error: aggregate `Match<I<int, S>, 0> v' has incomplete type and 
cannot be defined 
x.cc:12: error: storage size of `v' isn't known 
 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc 
x.cc:12: error: ambiguous class template instantiation for `struct 
Match<I<int, S>, 0>' 
x.cc:10: error: candidates are: struct Match<I<T, C>, i> 
x.cc:7: error:                 struct Match<I<T, C>, 0> 
x.cc:12: error: aggregate `Match<I<int, S>, 0> v' has incomplete type and 
cannot be defined 
x.cc:12: error: storage size of `v' isn't known 
 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
      Known to fail|                            |3.4.0 3.5.0
      Known to work|                            |3.3.4
           Priority|P3                          |P2
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-25 17:33:28
               date|                            |
            Summary|v3.4 regression: Failure to |[3.4/3.5 regression] Failure
                   |select obvious template     |to select obvious template
                   |specialisation              |specialisation
   Target Milestone|---                         |3.4.0


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]