On Mon, Jan 2, 2017 at 2:32 PM, Jakub Jelinek <ja...@redhat.com> wrote:
>           if (TREE_CODE (type) == REFERENCE_TYPE)
>             {
> -             error ("in C++98 %q+D may not have reference type %qT "
> -                    "because it is a member of a union", x, type);
> -             continue;
> +             if (cxx_dialect < cxx11)
> +               {
> +                 error ("in C++98 %q+D may not have reference type %qT "
> +                        "because it is a member of a union", x, type);
> +                 continue;
> +               }

I don't think we need the old error anymore; in C++98 mode we will
have already complained about a static data member reference, so we
can drop the above and just keep the below.

> +             else if (TREE_CODE (x) == FIELD_DECL)
> +               {
> +                 error ("non-static data member %q+D in a union may not "
> +                        "have reference type %qT", x, type);
> +                 continue;
> +               }

Jason

Reply via email to