[PATCH] D74468: [clang-tidy] No misc-definitions-in-headers warning on C++14 variable templates.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 12 07:55:41 PST 2020


hokein added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-definitions-in-headers-1z.hpp:14
+template<class T>
+constexpr T pi = T(3.1415926L);
----------------
gribozavr2 wrote:
> I would prefer if you could make the test compatible with all language modes after C++11. You can do it by wrapping the variable template in `#if`s on the `__cplusplus` macro that contains the language version.
I'd prefer keep it as it-is. using `__cplusplus` seems a bit hacky to me, and I think it only works for non-CHECK-MESSAGES cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74468





More information about the cfe-commits mailing list