This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3 PATCH] Fix an access problem in variant.
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 7 Feb 2017 23:29:14 +0200
- Subject: Re: [v3 PATCH] Fix an access problem in variant.
- Authentication-results: sourceware.org; auth=none
- References: <CAFk2RUY+car5uBT5o-sAJEGrPtWWJKXqcUs7MN=BQfJ3ysTj1A@mail.gmail.com>
On 7 February 2017 at 22:00, Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
> Currently, clang rejects all attempts to visit a libstdc++ variant:
> https://godbolt.org/g/kSmBTg
>
> While gcc doesn't reject such code, that seems like an access checking
> bug. This patch makes the offending _M_u member accessible for the rest
> of the code.
Hmh. There's already a friend declaration for the functions that
supposedly need it. clang doesn't
seem to grok that friend declaration. gcc requires that friend
declaration, so perhaps the bug
is indeed in how clang handles friend templates.