public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15898] New: Error with templated operator delete not detected
@ 2004-06-09 16:02 bangerth at dealii dot org
  2004-06-09 16:07 ` [Bug c++/15898] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2004-06-09 16:02 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/15898] Error with templated operator delete not detected
  2004-06-09 16:02 [Bug c++/15898] New: Error with templated operator delete not detected bangerth at dealii dot org
@ 2004-06-09 16:07 ` pinskia at gcc dot gnu dot org
  2004-06-09 16:10 ` bangerth at ices dot utexas dot edu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-09 16:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-09 16:07 -------
Confirmed, once this is fixed, I assume that PR 15890 will be fixed at the same time as then the 
examples in PR 15890 will be rejected.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |15890
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-09 16:07:20
               date|                            |


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/15898] Error with templated operator delete not detected
  2004-06-09 16:02 [Bug c++/15898] New: Error with templated operator delete not detected bangerth at dealii dot org
  2004-06-09 16:07 ` [Bug c++/15898] " pinskia at gcc dot gnu dot org
@ 2004-06-09 16:10 ` bangerth at ices dot utexas dot edu
  2004-06-10 10:43 ` giovannibajo at libero dot it
  2004-08-19 20:21 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at ices dot utexas dot edu @ 2004-06-09 16:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at ices dot utexas dot edu  2004-06-09 16:10 -------
Subject: Re:  Error with templated operator delete not detected

> Confirmed, once this is fixed, I assume that PR 15890 will be
> fixed at the same time as then the examples in PR 15890 will be rejected.

True. I'm not sure if PR 15890 isn't a separate problem, though, that will 
then simply be buried if the compiler rejects that testcase right away. It 
would be worth fixing 15890 first.

Note also that 15890 is a regression, whereas this one isn't.

W.
 
-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/



-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/15898] Error with templated operator delete not detected
  2004-06-09 16:02 [Bug c++/15898] New: Error with templated operator delete not detected bangerth at dealii dot org
  2004-06-09 16:07 ` [Bug c++/15898] " pinskia at gcc dot gnu dot org
  2004-06-09 16:10 ` bangerth at ices dot utexas dot edu
@ 2004-06-10 10:43 ` giovannibajo at libero dot it
  2004-08-19 20:21 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: giovannibajo at libero dot it @ 2004-06-10 10:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-06-10 10:43 -------
I will note that we don't need to actually call the delete operator to detect 
the error, the declaration itself should be rejected. So the minimal testcase 
which should be rejected is:

-----------------------
template < typename T > 
void operator delete ( void* raw ) {} 
-----------------------


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |2.95.3 3.3 3.4.0 3.5.0


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/15898] Error with templated operator delete not detected
  2004-06-09 16:02 [Bug c++/15898] New: Error with templated operator delete not detected bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2004-06-10 10:43 ` giovannibajo at libero dot it
@ 2004-08-19 20:21 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-08-19 20:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-08-19 20:21 -------


*** This bug has been marked as a duplicate of 15890 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE
   Target Milestone|---                         |3.4.2


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-08-19 20:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-09 16:02 [Bug c++/15898] New: Error with templated operator delete not detected bangerth at dealii dot org
2004-06-09 16:07 ` [Bug c++/15898] " pinskia at gcc dot gnu dot org
2004-06-09 16:10 ` bangerth at ices dot utexas dot edu
2004-06-10 10:43 ` giovannibajo at libero dot it
2004-08-19 20:21 ` mmitchel at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).