[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (#84050)" (PR #90152)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu May 2 16:06:56 PDT 2024


erichkeane wrote:

> @yxsamliu The type of `this` is always a pointer. The class member access operator may only be overloaded for operands of class type. In your reduced example, could you provide a value of `T` that would instantiate to a valid specialization?

Agreed, this is another case where your change is actually finding a bug!  @yxsamliu : see https://godbolt.org/z/PK38rodax

If you intend to call `A<typename T>::operator->` you have to spell it like this: https://godbolt.org/z/c9s3aqa7P



https://github.com/llvm/llvm-project/pull/90152


More information about the cfe-commits mailing list