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

            Bug ID: 88827
           Summary: Rejects valid program using &* operator combination.
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anders.granlund.0 at gmail dot com
  Target Milestone: ---

Test case (prog.c):

  int main()
  {
    struct S *p = 0;
    &*p;
  } 

Compilation command line:

  gcc prog.c -Wall -Wextra -std=c11 -pedantic-errors

Observed behaviour:

  The following error message was outputed:

    error: dereferencing pointer to incomplete type 'struct S'

Expected behaviour:

  No error messages outputed. The program is valid. Note that using the value
  0 for pointer  p  is not a problem since neither & nor * is evaluated due to
  the special rule for &* in 6.5.3.2/3.

Note:

  Clang accepts the program without outputing any error messages.

Reply via email to