[PATCH] D29877: Warn about unused static file scope function template declarations.

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 27 02:32:56 PDT 2017

v.g.vassilev added a comment.

In https://reviews.llvm.org/D29877#766301, @rsmith wrote:

> In https://reviews.llvm.org/D29877#766196, @EricWF wrote:
> > No. But I can point you to `range-v3` which uses this pattern and I think the idiom is somewhat appealing, but that's orthogonal to Clang diagnosing it.
> I found this:
> https://github.com/ericniebler/range-v3/blob/a4829172c0d6c43687ba213c54f430202efd7497/include/range/v3/view/zip_with.hpp#L44
> This code is wrong, and creates ODR violations on lines 190 and 200.
> It seems to me that the warning is firing on dangerous / broken code (yay!) but the warning is not sufficient to explain *why* the code is broken (boo!).

Perhaps we can complement this with a note, explaining the linkage situation if we fire the warning in a header file...


More information about the cfe-commits mailing list