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++/14622] New: type mismatch in explicit template instantiation not detected


The following code should produce an error for the explicit
template instantiation, because the type given for the static variable
doesn't match the one in the class template.  None of the following
gcc versions produces an error:

gcc version 2.95.3 20010315 (release)
gcc version 3.3
gcc version 3.5.0 20040118 (experimental)
gcc version 3.5.0 20040317 (experimental)



template<class T>
class A
{
  static T a;
};

template<class T>
T A<T>::a;

class B
{ };

template
int A<B>::a;       // type mismatch

-- 
           Summary: type mismatch in explicit template instantiation not
                    detected
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jens dot maurer at gmx dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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