hans added a comment. Okay, since checking this is cheap I suppose we can do it.
================ Comment at: clang/lib/Analysis/UninitializedValues.cpp:410 + if (FunctionDecl *fd = CE->getDirectCallee()) { + if (FunctionTemplateDecl *ftd = fd->getPrimaryTemplate()) + return ftd->getTemplatedDecl()->hasTrivialBody(); ---------------- Is this special check for templates necessary? Doesn't the "fd->hasTrivialBody()" check below also handle the template case? ================ Comment at: clang/test/SemaCXX/warn-uninitialized-const-reference.cpp:13 +template <class T> +inline void ignore_template(T const &) {} +void ignore(const int &i) {} ---------------- I think "const T &" would be the more common ordering. Also the "inline" isn't really necessary. ================ Comment at: clang/test/SemaCXX/warn-uninitialized-const-reference.cpp:40 + + int l; + ignore_template(l); ---------------- I would add a comment explaining that this is a pattern to avoid "unused variable" warnings, and mention the boost function as an example. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82425/new/ https://reviews.llvm.org/D82425 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits