EricWF added a comment. I think this patch still gets the following case wrong: // foo.h constexpr struct { template <class T> void operator()(T) {} // emits unused template warning } foo; https://reviews.llvm.org/D29877