[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 17 12:33:41 PDT 2024


================
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s
+
+struct S {
+  void f() {
+    ++this; // expected-error {{expression is not assignable}}
+    // expected-note at -1 {{add '*' to dereference it}}
----------------
zygoloid wrote:

This is a bad diagnostic change: adding the `*` doesn't help.

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


More information about the cfe-commits mailing list