https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89106

            Bug ID: 89106
           Summary: cast-to-union documentation incorrect w.r.t.
                    lvalueness
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: documentation
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amonakov at gcc dot gnu.org
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---

The patch for PR 71560 changed the wording in "Cast to a Union Type"
documentation section. It now reads:

    A cast to a union actually creates a compound literal and yields an lvalue,
not an rvalue like true casts do.

which is not true: a cast to union never produced an lvalue expression. The
last hunk in the patch was therefore incorrect:

-A cast to union type is similar to other casts, except that the type
-specified is a union type.  You can specify the type either with
-@code{union @var{tag}} or with a typedef name.  A cast to union is actually
-a constructor, not a cast, and hence does not yield an lvalue like
-normal casts.  (@xref{Compound Literals}.)
+A cast to union type looks similar to other casts, except that the type
+specified is a union type.  You can specify the type either with the
+@code{union} keyword or with a @code{typedef} name that refers to
+a union.  A cast to a union actually creates a compound literal and
+yields an lvalue, not an rvalue like true casts do.
+(@xref{Compound Literals}.)

Reply via email to