Quuxplusone / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
https://p1144.godbolt.org/z/jf67zx5hq
Other
0 stars 2 forks source link

Pointer-to-member-function should reject explicit object parameter ("deducing this") #24

Closed Quuxplusone closed 3 months ago

Quuxplusone commented 9 months ago

("Deducing this" implementation progress is being tracked in https://github.com/llvm/llvm-project/issues/59619 )

Clang accepts the following invalid code: https://godbolt.org/z/rr1TKejPz

struct S {
    int f(int);
};
using T = int (S::*)(this int);  // INVALID
T t = &S::f;

GCC correctly rejects:

error: a pointer to member function type cannot have an explicit object parameter
Quuxplusone commented 7 months ago

Probably will be resolved by @Sirraide's https://github.com/llvm/llvm-project/pull/89078

Quuxplusone commented 3 months ago

Fixed by #89078.