Skip to main content

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

I have recently found some time again to work on a CDT issue that was affecting one of my projects.

Having sat on this for a little, it's occurred to me that having BuiltinFffs implement ICPPExecution and not handle marshal() might be problematic. I guess it could be better to have a general "Builtin" implementation of ICPPExecution which can marshal. It could be extended to handle other builtins later.

However, I'm not overly familiar with how these things fit together and would still love to get some guidance / feedback.

Thanks,

Davin

On 16/5/22 11:52 pm, Davin McCall wrote:

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



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdt-dev

Back to the top