hokein added inline comments.
================
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
----------------
The original code should work as `-std=c++11` will be added defaultly by
`check_clang_tidy` script.
================
Comment at: test/clang-tidy/misc-definitions-in-headers.hpp:180
+class CE {
+ constexpr static int i = 5; // OK: constexpr definition.
+};
----------------
aaron.ballman wrote:
> This is not as safe as you might think. As-is, this is fine, however, if the
> class is given an inline function where that variable is odr-used, you will
> get an ODR violation.
>
> I think it's mildly better to err on the side of safety here and diagnose.
I think the current code (Line `97` in `DefinitionsInHeadersCheck.cpp`) has
already guaranteed this case. Can you try to run it without your change in the
`DefinitionsInHeadersCheck.cpp`?
I think it still makes sense to add `constexpr` test cases.
Repository:
rL LLVM
https://reviews.llvm.org/D34449
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits