[PATCH] __attribute__((enable_if)) and non-overloaded member functions
nlewycky at google.com
Tue May 26 19:54:47 PDT 2015
On 26 May 2015 at 13:20, Ettore Speziale <speziale.ettore at gmail.com> wrote:
> the attached patch fixes the case where __attribute__((enable_if)) is
> sticked to a member function with no overloads. It seems that in these case
> clang does not execute the code about overload resolution which contains
> the check about __attribute__((enable_if)). Hence it would be possible to
> use a function protected by __attribute__((enable_if)) even if the
> __attribute__((enable_if)) predicate is false.
I think this will cause the enable_if expression to be evaluated multiple
times if the expression is not dependent but appertains to a function
template, such as:
template <typename T> void foo(int i, T t) __attribute__((enable_if(i==0,
I'm not sure how to fix that without hoisting it up to ActOnCallExpr? Could
you check whether this is a real problem?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits