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

Reply via email to