[Bug c++/121839] New: ICE: tree check: expected tree_binfo, have error_mark in adjust_result_of_qualified_name_lookup, at cp/search.cc:1487

stevenxia990430 at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Sep 6 23:37:32 GMT 2025


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

            Bug ID: 121839
           Summary: ICE: tree check: expected tree_binfo, have error_mark
                    in adjust_result_of_qualified_name_lookup, at
                    cp/search.cc:1487
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stevenxia990430 at gmail dot com
  Target Milestone: ---

The following invalid program reports an internal compiler error: tree check:
expected tree_binfo, have error_mark in adjust_result_of_qualified_name_lookup,
at cp/search.cc:1487

To quickly reproduce: https://gcc.godbolt.org/z/4fMbK9jTe
```
template <typename Derived, typename Base>
class CRTPRepr : public Base {
public:
};

struct BaseVirtual {
    virtual void foo() { while(false); }
};

template <typename T>
class MultiInherit : public CRTPRepr<T, BaseVirtual>,  public virtual
BaseVirtual {
public:
    void invoke(){
        this->foo();
    }
};

struct Derived : MultiInherit<Derived> {
};

int main() {
    Derived d; 
    d.invoke();
}
```


More information about the Gcc-bugs mailing list