[PATCH] D44536: Avoid segfault when destructor is not yet known

Dimitry Andric via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 15 13:41:47 PDT 2018


dim added a comment.

In https://reviews.llvm.org/D44536#1039420, @rjmccall wrote:

> I'm not sure it's supposed to be a valid state to get into IRGen with a non-trivial destructor that isn't yet declared.  Richard?


As a side note, clang also emits a warning about it (but then crashes :) ):

  VMMapsMain-minimized.cpp:10:18: warning: deleting pointer to incomplete type 'c' may cause undefined behavior
    virtual ~d() { delete e; }
                   ^      ~
  VMMapsMain-minimized.cpp:7:7: note: forward declaration of 'c'
  class c;
        ^
  Segmentation fault


Repository:
  rC Clang

https://reviews.llvm.org/D44536





More information about the cfe-commits mailing list