[PATCH] D143840: [clang] Add the check of membership for the issue #58674 and improve the lookup process

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 23 08:05:52 PST 2023


alexfh added a comment.

In D143840#4147582 <https://reviews.llvm.org/D143840#4147582>, @joanahalili wrote:

> In D143840#4147234 <https://reviews.llvm.org/D143840#4147234>, @joanahalili wrote:
>
>> Heads up: We are experiencing a series of clang crashes because of this commit.
>>
>> What we already have so far:
>>
>>   Unhandled DeclRefExpr
>>   UNREACHABLE executed at clang/lib/CodeGen/CGExpr.cpp:2958!
>>
>> We are now working on a reproducer.
>
> Here is our reproducer:
>
>   struct a {
>     enum { b };
>   };
>   struct c {
>     void *d;
>   };
>   struct e {
>     void f(void *);
>   };
>   template <typename g> struct h : g {
>     h(short, int);
>     virtual void i();
>   };
>   template <typename g> void h<g>::i() { e().f(c::d); }
>   struct j : h<c> {
>     j();
>   };
>   int k;
>   j::j() : h(a::b, k) {}

Thanks! This looks like a real problem. I'm going to revert the commit.

BTW, I managed to reduce your test case slightly more:

  struct f {
    void *g;
  };
  template <typename j> struct k : j {
    virtual void l(){ (void)f::g; }
  };
  k<f> q;

https://gcc.godbolt.org/z/fa33GYf9K


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143840/new/

https://reviews.llvm.org/D143840



More information about the cfe-commits mailing list