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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|internal compiler error: in |[10/11/12/13/14 Regression]
                   |dwarf2out_finish            |ICE in dwarf2out_finish
                   |                            |with local class with
                   |                            |inherited operator delete
                   |                            |in a templated function and
                   |                            |-g
   Target Milestone|---                         |10.5
     Ever confirmed|0                           |1
      Known to work|                            |5.1.0, 5.5.0
      Known to fail|                            |10.1.0, 6.1.0, 7.1.0
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2023-06-17

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
```
template <typename T>
struct QCachedT
{
  void operator delete(void *, T *) {}
};
template<int a>
void exercise()
{
  struct thing_t
    : QCachedT<thing_t>
  {
  };
  thing_t *list[1];
  new thing_t;
}
int main() { exercise<1>(); }
```

Note exercise needs to be templated and so does QCachedT.
My guess is thing_t that is for the operator delete is not be subsituted
correctly for the new class when instantiating exercise; it works ok without -g
but when trying to emit debug info, it crashes not knowing the class.

Reply via email to