[llvm-dev] Change LLVM_ATTRIBUTE_DEPRECATED macro to [[deprecated]]

Christian Sigg via llvm-dev llvm-dev at lists.llvm.org
Sat Jan 9 01:50:09 PST 2021


> One potential issue is the possible existence of compilers that claim to
support C++14, but are not fully compliant.

At least from the compilers listed [here](
https://en.cppreference.com/w/cpp/compiler_support#cpp14), all of them
support the [[deprecated]] attribute.

> The only downside I'm aware of is
>   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96117

Thanks for pointing that out Stephen. I couldn't find any instance where
LLVM_ATTRIBUTE_DEPRECATED is used in combination with another attribute and
gcc's deficiency doesn't manifest itself on functions (
https://godbolt.org/z/er9Pax), so hopefully this is only a theoretical
problem.

If there are no objections, I will go ahead with D94219 and wait two weeks
to see if any problems pop up before changing the call sites.

On Fri, Jan 8, 2021 at 11:12 PM Stephen Kelly via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> On 08/01/2021 11:05, Christian Sigg via llvm-dev wrote:
> > The LLVM_ATTRIBUTE_DEPRECATED macro marks e.g. function declarations as
> > deprecated.
> >
> > C++14 introduced the [[deprecated]] attribute, and I would like to
> > switch LLVM's code to that because it's portable, easier to read, and
> > can be applied to inline functions as well.
> >
> > https://reviews.llvm.org/D94219 is the first step towards that by
> > changing the LLVM_ATTRIBUTE_DEPRECATED implementation from
> > __attribute__/__declspec to [[deprecated]]. In a follow-up change, I
> > will switch the call sites to use [[deprecated]] directly and finally
> > remove the macro.
> >
> > Are there any downsides that I'm missing or any objections?
>
> The only downside I'm aware of is
>
>   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96117
>
> I don't think the llvm build uses export macros, but are there any
> places where different attribute types are used?
>
> Thanks,
>
> Stephen.
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210109/a86ac216/attachment.html>


More information about the llvm-dev mailing list