[PATCH] D54475: [clangd] Allow observation of changes to global CDBs.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 19 09:59:41 PST 2018


sammccall added inline comments.


================
Comment at: clangd/Function.h:147
+private:
+  static_assert(std::is_same<typename std::decay<T>::type, T>::value,
+                "use a plain type: event values are always passed by const&");
----------------
ilya-biryukov wrote:
> NIT: Maybe move this static_assert to the top of the class?
> I'd argue this is part of the public interface as it puts constraints on the template parameters.
On balance I don't think I agree here.

I'm not sure about having the static assert at all, unless we have reason to believe it will compile but do the wrong thing. Happy to compromise by including it, but I don't think it belongs up front.
It's not very human-readable, and computers are just as happy with it in the private section.  It's consistent with some other ways of disallowing compilation, like declaring members private.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54475





More information about the cfe-commits mailing list