-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Closed
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
See:
constexpr _Complex double d = {1.0, 2.0, 3.0, 45};
constexpr double e[2] = {1.0, 2.0, 3.0, 45};Godbolt: https://godbolt.org/z/P7vqM4dq9
Output:
<source>:3:37: error: excess elements in scalar initializer
constexpr _Complex double d = {1.0, 2.0, 3.0, 45};
^~~
<source>:4:42: error: excess elements in array initializer
constexpr double e[2] = {1.0, 2.0, 3.0, 45};
^~~Clang highlights the second entry for the _Complex variable, but it should highlight the third I think.
I have other issues with the diagnostics here, but since this is about _Complex and that is a fringe feature anyway, I don't care much about those and fixing the off-by-one error should be enough.
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute