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++/16160] New: Does not reject invalid attempt of explicit instantiation


This code is invalid, yet we do not (and never have) issue a diagnostic: 
------------------- 
template <int N> struct X {}; 
struct X<2>; 
------------------- 
 
That's particularly bad, since it can lead to very subtle problems: in my 
application, X had a whole number of members, and I had really meant to 
_instantiate_ it with 
  template struct X<2>; 
but forgot the 'template'. I just ended up with missing instantiations for 
which I didn't have a good explanation :-] 
 
W.

-- 
           Summary: Does not reject invalid attempt of explicit
                    instantiation
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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