public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42514]  New: Invalid Destructor Name of A Template Class Is Accepted
@ 2009-12-27  7:45 shreks2099 at yahoo dot com
  2009-12-27 10:09 ` [Bug c++/42514] [4.3/4.4/4.5 Regression] " paolo dot carlini at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: shreks2099 at yahoo dot com @ 2009-12-27  7:45 UTC (permalink / raw)
  To: gcc-bugs

Obviously the following code of the definition of class destructor is wrong,
but it passed g++ 4.4.2 in Fedora 12. However g++ 4.1.2 and g++ 3.4.6 in Fedora
12 reported the error.

The testing code is list below:

#include <iostream>

template <typename T>
class Base
{
  public:
        Base();
        ~Base();
};

template <typename T>
Base<T>::Base()
{
        std::cout << "Base()" << std::endl;
}

template <typename T>
Base<T>::~BaseTypo()
{
        std::cout << "~BaseTypo()" << std::endl;
}

int main()
{
        Base<int>* pObj = new Base<int> ();
        delete pObj;
        return 0;
}


-- 
           Summary: Invalid Destructor Name of A Template Class Is Accepted
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: shreks2099 at yahoo dot com


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


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

* [Bug c++/42514] [4.3/4.4/4.5 Regression] Invalid Destructor Name of A Template Class Is Accepted
  2009-12-27  7:45 [Bug c++/42514] New: Invalid Destructor Name of A Template Class Is Accepted shreks2099 at yahoo dot com
@ 2009-12-27 10:09 ` paolo dot carlini at oracle dot com
  2009-12-27 19:36 ` hjl dot tools at gmail dot com
  2009-12-30 19:35 ` [Bug c++/42514] [4.3/4.4 " jason at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-12-27 10:09 UTC (permalink / raw)
  To: gcc-bugs



-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |accepts-invalid
      Known to fail|                            |4.3.3 4.4.2 4.5.0
      Known to work|                            |4.2.5
   Last reconfirmed|0000-00-00 00:00:00         |2009-12-27 10:09:12
               date|                            |
            Summary|Invalid Destructor Name of A|[4.3/4.4/4.5 Regression]
                   |Template Class Is Accepted  |Invalid Destructor Name of A
                   |                            |Template Class Is Accepted


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


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

* [Bug c++/42514] [4.3/4.4/4.5 Regression] Invalid Destructor Name of A Template Class Is Accepted
  2009-12-27  7:45 [Bug c++/42514] New: Invalid Destructor Name of A Template Class Is Accepted shreks2099 at yahoo dot com
  2009-12-27 10:09 ` [Bug c++/42514] [4.3/4.4/4.5 Regression] " paolo dot carlini at oracle dot com
@ 2009-12-27 19:36 ` hjl dot tools at gmail dot com
  2009-12-30 19:35 ` [Bug c++/42514] [4.3/4.4 " jason at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-27 19:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hjl dot tools at gmail dot com  2009-12-27 19:36 -------
It is caused by revision 143502:

http://gcc.gnu.org/ml/gcc-cvs/2009-01/msg00515.html

and revision 144314:

http://gcc.gnu.org/ml/gcc-cvs/2009-02/msg00481.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com


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


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

* [Bug c++/42514] [4.3/4.4 Regression] Invalid Destructor Name of A Template Class Is Accepted
  2009-12-27  7:45 [Bug c++/42514] New: Invalid Destructor Name of A Template Class Is Accepted shreks2099 at yahoo dot com
  2009-12-27 10:09 ` [Bug c++/42514] [4.3/4.4/4.5 Regression] " paolo dot carlini at oracle dot com
  2009-12-27 19:36 ` hjl dot tools at gmail dot com
@ 2009-12-30 19:35 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-12-30 19:35 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]



------- Comment #2 from jason at gcc dot gnu dot org  2009-12-30 19:35 -------
4.5 already says

wa.C:8:11: error: declaration of ‘~typename Base<T>::BaseTypo’ as member of
‘Base<T>’

for this testcase.  Closing as fixed, as backporting the fix seems a little
risky for an invalid code bug.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|4.3.3 4.4.2 4.5.0           |4.3.3 4.4.2
      Known to work|4.2.5                       |4.2.5 4.5.0
         Resolution|                            |FIXED
            Summary|[4.3/4.4/4.5 Regression]    |[4.3/4.4 Regression] Invalid
                   |Invalid Destructor Name of A|Destructor Name of A
                   |Template Class Is Accepted  |Template Class Is Accepted
   Target Milestone|---                         |4.5.0


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


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

end of thread, other threads:[~2009-12-30 19:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-27  7:45 [Bug c++/42514] New: Invalid Destructor Name of A Template Class Is Accepted shreks2099 at yahoo dot com
2009-12-27 10:09 ` [Bug c++/42514] [4.3/4.4/4.5 Regression] " paolo dot carlini at oracle dot com
2009-12-27 19:36 ` hjl dot tools at gmail dot com
2009-12-30 19:35 ` [Bug c++/42514] [4.3/4.4 " jason 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).