[Clang] Improve designated inits diagnostic location
authorBill Wendling <morbo@google.com>
Fri, 7 Apr 2023 18:35:29 +0000 (11:35 -0700)
committerBill Wendling <morbo@google.com>
Fri, 7 Apr 2023 18:37:05 +0000 (11:37 -0700)
commit2cbf5127d58553fd6224a1ec809536bccc5b8510
treea94dec1ad320b479287335d0311b07636b850b2b
parentd585a8afdf2f70159759dccb11d775cdf432aba4
[Clang] Improve designated inits diagnostic location

A "null" designator won't have a valid location. Try to approximate this
location as best we can in that situation.

Closes 61118
Closes 46132

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D147673
clang/lib/Sema/SemaInit.cpp
clang/test/SemaCXX/cxx2b-designated-initializers.cpp [new file with mode: 0644]