<div style="font-family: arial, helvetica, sans-serif"><font size="2">I recently added the support to use __attribute__((unused)) on fields to silence -Wunused-private-field. Now, for backwards compatibility of new source files, we need a way to determine (e.g. in a header file) whether this is supported in the used clang version.<div>
<br></div><div>Currently __has_feature, __has_extension and __has_attribute implement something similar, but this change does not really fit any of those categories as it should be considered a bug. Not allowing this attribute on fields was an oversight that was fixed. Thus I (after discussion with chandlerc) suggest introducing __has_bug. </div>
<div><br></div><div>This should default to 1 (all bugs that are not explicitly fixed in a clang version are still bugs) and to provide compatibility with other compilers, sources can used:</div><div>#ifndef __has_bug</div>
<div># define __has_bug(x) __clang__</div><div>#endif</div><div><br></div><div>Any thoughts?</div><div>Daniel</div></font></div>