sdkrystian wrote:

@Caslyn [[expr.prim.this] p3](http://eel.is/c++draft/expr.prim.this#3) states:
> [...] the expression this is a prvalue of type “pointer to _cv-qualifier-seq_ 
> `X`” wherever `X` is the current class [...]

And [[over.match.oper] p1](http://eel.is/c++draft/over.match.oper#1) states:
> If no operand of an operator in an expression has a type that is a class or 
> an enumeration, the operator is assumed to be a built-in operator and 
> interpreted according to 
> [[expr.compound]](http://eel.is/c++draft/expr.compound).

Since the type of `this` is a pointer, `++this` uses the built-in prefix 
increment operator. The operand of the built-in prefix increment operator must 
be an lvalue (and `this` is a prvalue).

https://github.com/llvm/llvm-project/pull/92283
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to