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++/15898] New: Error with templated operator delete not detected


3.7.3.2/2 specifically says that an operator delete that is a template 
shall have at least two function arguments. That makes sense, since the 
first one is fixed to be void*, so in order to deduce template 
arguments, we need at least a second function argument. However, as  
originally noted in PR 15890, this does not trigger an error: 
--------------- 
template < typename T > 
void operator delete ( void* raw ) {} 
 
int main() { 
  char* a = new char; 
  delete a; 
} 
--------------- 
 
All gcc versions simply accept this. 
 
W.

-- 
           Summary: Error with templated operator delete not detected
           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,jkherciueh at gmx dot
                    net


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


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