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++/25548] New: Rejects dependent deconstructor on a non depdendent name (for basic types) too late


Testcase:
class Foo {};

struct Bing
{
  char *GetChar();
};

template<typename T> struct Bar
{
  void Wibble()
  {
    bing.GetChar()->~T(); // How can this be legal if T isn't char?
  }
  Bing bing;
};

-----
If we change the return type of GetChar() to Foo * (from char*), we get an
error:
t.cc: In member function ?void Bar<T>::Wibble()?:
t.cc:12: error: the type being destroyed is ?Foo?, but the destructor refers to
?T?


-- 
           Summary: Rejects dependent deconstructor on a non depdendent name
                    (for basic types) too late
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


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