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

            Bug ID: 124187
           Summary: No diagnostic for conflicting array types when
                    preceded by extern declaration
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: katzdm at gmail dot com
  Target Milestone: ---

Consider the program

```cpp
extern int arr[];  // #1
int h() {
    extern int arr[2];
    return arr[1];
}
int arr[1];
```

GCC diagnoses when this program is either
- compiled in C mode or
- compiled in C++ code with #1 commented,

but does not diagnose when compiled in C++ mode as-is. I assume this should be
diagnosed (despite MSVC also accepting).

Reply via email to