Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Patch for review - constexpr evaluation of __builtin_ffs

Hi cdt-dev,

I'm a long-time lurker on this list, though I have made a few minor contributions in the past.

I have recently found some time again to work on a CDT issue that was affecting one of my projects. As detailed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=579934 :

The following code gives "invalid template arguments" on the var declaration:

--- begin ---
template <unsigned V>
class TT
{

};

TT<__builtin_ffs(4)> var;
--- end ---

I have a fix for this though I'm a little uncertain of the approach. It "seems to work" but unfortunately the unit tests don't seem to correctly recognize builtin functions and so I couldn't add a test (I tried to put one in org.eclipse.cdt.core.parser.tests.ast2.cxx14.constexpr.IntegralValueTests, but not luck as I mentioned).

It'd be appreciated if someone with appropriate knowledge and experience would have a look at the patch:

    https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/193395

Regards,

Davin



Back to the top