[PATCH] D139705: [clang] fix zero-initialization fix-it for variable template

Vincent Hong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 10 09:59:52 PST 2023


v1nh1shungry added inline comments.


================
Comment at: clang/test/FixIt/fixit-const-var-init.cpp:24
+
+template <> constexpr float d<int, float>; // expected-error {{must be initialized by a constant expression}}
+// CHECK: fix-it:"{{.*}}":{24:42-24:42}:" = 0.0"
----------------
aaron.ballman wrote:
> I'd like to see some additional test coverage for more complicated declarators:
> ```
> void (* const func)(int, int);
> const int var [[clang::annotate("")]];
> ```
One more question: I just did the second test

```
const int var [[clang::annotate("")]];
```

and it inserted the fix hint after the identifier.

Is this the expected behavior of `getEndLoc()`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139705/new/

https://reviews.llvm.org/D139705



More information about the cfe-commits mailing list