Inline variable definitions should be ok in headers.
https://stackoverflow.com/questions/34445336/constexpr-global-constants-in-a-header-file-and-odr
Differential D34449
[clang-tidy] Enable inline variable definitions in headers. xazax.hun on Jun 21 2017, 7:03 AM. Authored by
Details Inline variable definitions should be ok in headers. https://stackoverflow.com/questions/34445336/constexpr-global-constants-in-a-header-file-and-odr
Diff Detail Event Timeline
Comment Actions Have thought this a bit more, I misunderstood your patch previously (sorry for that). I think what you intend to do is to ignore C++17 inline variables in headers, am I correct?
Comment Actions BTW, could you please also update the docs/clang-tidy/checks/misc-definitions-in-headers.rst?
Comment Actions Looks good, thanks!
|
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.