[PATCH] D34449: [clang-tidy] Enable constexpr definitions in headers.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 27 12:14:00 PDT 2017

hokein added a comment.

BTW, could you please also update the `docs/clang-tidy/checks/misc-definitions-in-headers.rst`?

Comment at: test/clang-tidy/misc-definitions-in-headers-1z.hpp:5
+class CE {
+  constexpr static int i = 5;
Could you follow the way of comment in the `misc-definitions-in-headers-1z.hpp`? For each allowed case, add the comment like `constexpr static int i = 5; // OK: inline variable definition.`

The same below.

Comment at: test/clang-tidy/misc-definitions-in-headers-1z.hpp:10
+constexpr int a = 1;
I think this case is allowed because of internal linkage. I'd suggesting putting it to `misc-definitions-in-headers.hpp`.


More information about the cfe-commits mailing list