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++/71748] ICE on valid (?) C++ template code invoking a base destructor: in build_base_path, at cp/class.c:304


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71748

--- Comment #1 from Zhendong Su <su at cs dot ucdavis.edu> ---
If we remove the template from the code, it'll be accepted: 

$ g++-trunk -c -Wall -Wextra -std=c++11 good.cpp
$ 
$ cat good.cpp
struct A 
{
  virtual ~A () {}
};

struct B : public A 
{
  virtual ~B () {} 
};

void foo ()
{
  B *b = new B;
  b->~A (); 
  // also accepted: b->A::~A(); 
}

int main ()
{
  foo (); 
  return 0;
}

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