-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed as not planned
Closed as not planned
Copy link
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillacclang: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 analyzerwontfixIssue is real, but we can't or won't fix it. Not invalidIssue is real, but we can't or won't fix it. Not invalid
Description
| Bugzilla Link | 9082 |
| Version | trunk |
| OS | All |
| CC | @ostash,@zygoloid |
Extended Description
According to the C standard, conversions like the following are technically casting away const-ness, because array types are never qualified: qualifiers apply only to the element type.
const void * -> const int ()[5]
const int * -> const int ()[5]
Similarly, this is not supposed to be a valid qualification conversion:
int ()[10] -> const int ()[10]
These are kindof arbitrary restrictions that do make life unnecessarily difficult for real users; I think clang's model (where the array and element are simultaneously qualified) really makes a lot more sense. Nonetheless, we should at the very least provide -pedantic warnings about these conversions not being permitted by the standard(s).
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillacclang: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 analyzerwontfixIssue is real, but we can't or won't fix it. Not invalidIssue is real, but we can't or won't fix it. Not invalid