Skip to content

[Clang] Frontend crash compiling struct/class method with explicit object parameters #126720

@R-Goc

Description

@R-Goc

Frontend crash regression when compiling this code. Required flags: -std=c++23/26 (for explicit object parameters)
Works on 19.1.0 even with assertions, crashes on master(both with assertions and without)

void operator*(auto) {}

template <typename T>
struct Quaternionz {
    void inverse(this Quaternionz<T>& a) {
        a.inverse() * 0;
    }
};

int main() {}

Quaternionz can be a class as well, and inverse can just accept (this Quaternionz& a) and still crash. Function/object names can be shortened.
Looks like it is an issue with parsing explicit object parameters.

Godbolt link: https://clang.godbolt.org/z/1cYvc66j4
Full godbolt link

Metadata

Metadata

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions