On Wednesday 18 September 2024 13:00:38 GMT-7 Mathias Hasselmann via Development wrote: > Why that "inline" attributes at all? For functions and static data > members the "constexpr" attribute implies "inline" already: > https://timsong-cpp.github.io/cppwp/n4861/dcl.constexpr > > What's the reason for this excessive use of redudant "inline" attributes?
Because unfortunately we've found out that it isn't enough and thus not redundant. 1) the implicit "inline" does not apply to template specialisations, so you must remember it in those See a06f3e823bea0361125a10dd361f6fd50a4041cc 2) Clang emits "unused variable" for non-template constexpr, but not for constexpr inline See https://gcc.godbolt.org/z/hEjzfdz1n It also emits if you add static, but that's true for all static variables Therefore, our constexpr variables should be explicitly inline too, to avoid those problems. The question is only the order in which we spell those two keywords out. -- Thiago Macieira - thiago.macieira (AT) intel.com Principal Engineer - Intel DCAI Platform & System Engineering
smime.p7s
Description: S/MIME cryptographic signature
-- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development