Christopher Bazley - 14 hours ago

Please consider the attached candidate patch.

It checks association types for compatibility independently of whether they match the controlling type. It retains the checks for multiple defaults and multiple matches. It uses compatibleTypes so compatible pointers to arrays with an unspecified versus specified bound are detected too.

The proposed patch can only be applied after the candidate fix for [bugs:#4133], whose qualifier check distinguishes bit-precise types correctly. The new diagnostic follows the existing enum sequence, whether or not the [bugs:#4135] diagnostic has already been added.

Testing: 98 diagnostic checks passed. Diagnostic configurations tested: Z80, STM8, MCS51, MCS51 large, MCS51 stack-auto, PDK14, S08. All focused checks passed. The counts include positive controls as well as expected diagnostics.

 

Related

Bugs: #4133
Bugs: #4135