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

NagaChaitanya Vellanki via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 21 01:21:07 PDT 2023


chaitanyav added a comment.

  test.cpp:2:34: error: excess elements in scalar initializer
  _Complex double dd = {1.0, 2.0 , 3.0};
                                   ^~~
  test.cpp:3:32: error: excess elements in scalar initializer
  _Complex float fd = {1.0, 2.0, 3.0, 4.0, 5.0};
                                 ^~~
  test.cpp:4:42: error: excess elements in scalar initializer
  constexpr _Complex double d = {1.0, 2.0, 3.0, 45};
                                           ^~~
  test.cpp:11:23: error: no viable conversion from 'foo' to '_Complex double'
  _Complex double ds = {f, 1.0, b};
                        ^
  test.cpp:13:28: error: no viable conversion from 'foo' to 'double'
  _Complex double fg = {1.0, f};
                             ^
  test.cpp:15:33: error: excess elements in scalar initializer
  _Complex double gg = {1.0, 2.0, f};
                                  ^
  6 errors generated.                  

Tested various scenarios to ensure the behavior is as expected. Please review


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