https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79301

--- Comment #5 from Anders Kaseorg <andersk at mit dot edu> ---
(In reply to Jakub Jelinek from comment #4)
> (In reply to Anders Kaseorg from comment #3)
> > (In reply to Jakub Jelinek from comment #2)
> > > I think right now you need to use
> > > #ifdef __has_cpp_attribute
> > > # if __has_cpp_attribute(fallthrough) >= __cplusplus
> > >     [[fallthrough]];
> > 
> > Surely you intended* #if __has_cpp_attribute(fallthrough) && __cplusplus >=
> > __has_cpp_attribute(fallthrough)?
> 
> No, I meant what I wrote.  __has_cpp_attribute(fallthrough) gives you the
> year + month when the feature has been introduced, and you then use it only
> if it has been introduced before or at the same time as the C++ version
> (__cplusplus gives you again year + month) you are compilining for.

For the nonzero case, “before or at the same time” translates to <=, not >=.

Reply via email to