[PATCH] D73413: [clang-tidy] Add check to detect external definitions with no header declaration

Tony Lewis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 28 01:43:48 PST 2020


tonyelewis added a comment.

Thank you very much for coming back to this and for bringing the changes up to date. I still think this would be really valuable.

> Right now it will flag template definitions in source files, Is this good or bad behaviour?

Do you mean that both of the following would be flagged?

  // a.cpp
  template <typename> void f() {}
  template <typename> class C {};

I'm not sure how I feel about that. It feels to me like a less clear signal that the implementation file is mistakenly out of sync with the headers. Also, I think it's better to err on the side of being conservative about what we flag at first, knowing we can always consider flagging more later on. But I'm not well enough informed to have strong feelings.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73413/new/

https://reviews.llvm.org/D73413



More information about the cfe-commits mailing list