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

            Bug ID: 98397
           Summary: C2X: pointers to arrays with qualifiers are now
                    pointers to qualified types
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: muecker at gwdg dot de
  Target Milestone: ---

C2X mostly adopted the rules already implemented in GCC as an extension.

Still, there are two issues:

1. Some pedantic warning should not appear anymore in C2X.

2. The qualifier of a void pointer returned by the tertiary
operator changes in C2X when the one of the pointers points
to an array with qualified type. (This is then also consistent
with C++ and clang)


The following code should compile:


void foo(void)
{
        const int (*u)[1];
        void *v;
        extern const void *vc;
        extern typeof(1 ? u : v) vc;
        extern typeof(1 ? v : u) vc;
}


I have a patch for this in preparation.

Reply via email to