[PATCH] [PATCH] PR9804 - __is_signed conflicts with libstdc++

Richard Smith richard at metafoo.co.uk
Tue Apr 21 13:39:13 PDT 2015


On Tue, Apr 21, 2015 at 12:28 PM, Charlie Turner <charlesturner7c5 at gmail.com
> wrote:

> Hi Richard, thanks for taking a look.
>
> The motivation is that I have code that looks a bit like,
>
> ------------------8<--------------------------
> typedef bool BOOL;
>
> class Foo {
>     static const BOOL __is_signed;
>

__is_signed is a reserved identifier, so your code is ill-formed (no
diagnostic required). The existing compatibility hack exists to work around
an issue with libstdc++, which (being part of the implementation) is
permitted to use names like this, not to support user code doing this sort
of thing.


>   };
>
> #include <map>
>
> int main() {}
> ------------------>8--------------------------
>
> and that Clang fails to compile it,
>
> test.c:4:23: error: expected member name or ';' after declaration
> specifiers
>     static const BOOL __is_signed;
>     ~~~~~~~~~~~~~~~~~ ^
>
> - Charlie.
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150421/ce2f4edc/attachment.html>


More information about the cfe-commits mailing list