[RFC][clang-tidy] Misplaced array index

Hi!

I am working on a new clang-tidy checker. It will warn on misplaced array indexes. This syntax is valid but unusual.

Example code:

char x = 1[“abc”];

Fixit “abc”[1].

I have attached a proof of concept patch.

Any comments on this?

//Anders

misplaced_array.diff (6.7 KB)

Hi!

I am working on a new clang-tidy checker. It will warn on misplaced array indexes. This syntax is valid but unusual.

Example code:

char x = 1[“abc”];

Fixit “abc”[1].

I have attached a proof of concept patch.

Any comments on this?

//Anders