[PATCH] D146503: Fix highlighting issue with _complex and initialization list with more than 2 items

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 23 05:55:53 PDT 2023


aaron.ballman added a comment.

The precommit CI failures are unrelated to your changes (the Debian one is related to flang failures and the libcxx one seems to be related to infrastructure), so no need to worry about them.



================
Comment at: clang/test/Sema/complex-init-list.c:37
 struct teststruct invalid1 = { 1, 2 }; // expected-warning {{excess elements}}
-_Complex float invalid2 = { 1, 2, 3 }; // expected-warning {{excess elements}}
+_Complex float invalid2 = { 1, 2, 3 }; // expected-warning {{specifying real and imaginary components is an extension}} expected-warning {{excess elements in scalar initializer}}
 _Complex float invalid3 = {}; // expected-error {{scalar initializer cannot be empty}} expected-warning {{GNU empty initializer}}
----------------
chaitanyav wrote:
> aaron.ballman wrote:
> > This makes it a bit easier to see that there are two diagnostics being fired (even though we're not consistently doing that in this test file).
> Yeah, one because its an extension and other because it has excess elements. Checked this file added that on lines its applicable.
I'd still like to see these two changes made (where we use a line continuation character to put the diagnostic messages on their own lines instead of mashed together on one long line).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146503



More information about the cfe-commits mailing list