[PATCH] D34449: [clang-tidy] Enable inline variable definitions in headers.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 28 04:30:32 PDT 2017
hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.
Looks good, thanks!
Comment at: test/clang-tidy/misc-definitions-in-headers.hpp:1
-// RUN: %check_clang_tidy %s misc-definitions-in-headers %t
+// RUN: %check_clang_tidy %s misc-definitions-in-headers %t -- -- -std=c++1z
> hokein wrote:
> > hokein wrote:
> > > The original code should work as `-std=c++11` will be added defaultly by `check_clang_tidy` script.
> > `constexpr` variables have internal linkage, which should be detected for the current check (but the test case is missing this kind of case).
> > If you want to test `inline` variables, I'd suggest adding a new test file like `misc-definitions-in-headers-1z.hpp` which includes cases of inline variables.
> It looks like `-std=c++11` is not added.
OK. Yes, you are right.
The `-std=c++11` only be added if the test file extension is `cpp`. I think we can extend the check_clang_tidy.py script to support it, but it can be done in a follow-up.
More information about the cfe-commits