[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

Ben Hamilton via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 7 06:26:36 PST 2018


I made it longer so the two lines (__attribute__((foo)) vs. [[foo]]) had
the same length.

If I shorten it much more, everything goes on one line.

On Wed, Mar 7, 2018, 03:42 Krasimir Georgiev via Phabricator <
reviews at reviews.llvm.org> wrote:

> krasimir added inline comments.
>
>
> ================
> Comment at: unittests/Format/FormatTest.cpp:6068-6069
> +  verifyFormat("void f() [[deprecated(\"so sorry\")]];");
> +  verifyFormat("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
> +               "    [[unused]] aaaaaaaaaaaaaaaaaaaaaaa(int i);");
> +}
> ----------------
> benhamilton wrote:
> > I couldn't figure out why this breaks before the `[` in `[[unused]]`,
> when the identical test using `__attribute__((unused))` above does *not*
> break before the `__attribute__`.
> >
> > I ran with `-debug` and the two seem fairly similar. Can anyone help
> shed light on this?
> >
> > ## With `__attribute__((unused))`
> >
> > P8067
> >
> > ## With `[[unused]]`
> >
> > P8068
> The block of `a`-s appears to be longer here than in the `__attribute__`
> example. That might be a reason.
>
>
> Repository:
>   rC Clang
>
> https://reviews.llvm.org/D43902
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180307/1b4d5c8a/attachment-0001.html>


More information about the cfe-commits mailing list