[Bug c++/123805] New: Parentheses aggregate initialization incorrectly rejected when self referencing

luigighiron at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Jan 24 08:33:40 GMT 2026


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

            Bug ID: 123805
           Summary: Parentheses aggregate initialization incorrectly
                    rejected when self referencing
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luigighiron at gmail dot com
  Target Milestone: ---

The following code is incorrectly rejected by GCC:

int main(){
    void*a[1](a);
}

This error seems specific to naming a in the initializer, replacing (a) with
(nullptr) makes the error go away. Clang and MSVC accept this.


More information about the Gcc-bugs mailing list