https://bugs.llvm.org/show_bug.cgi?id=47693

            Bug ID: 47693
           Summary: C++20 Designated Initializers - Multiple
                    initializations of same struct member
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangb...@nondot.org
          Reporter: c...@synopsys.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Hi,

I believe Clang shouldn't compile the code below with -std=c++20.

struct X
{
    int a;
};

int main()
{
    X x{.a = 0, .a = 1};
    return 0;
}

GCC fails to compile it with the error:
error: '.a' designator used multiple times in the same initializer list

   14 |     X x{.a = 0, .a = 1};


Clang trunk successfully compiles the example.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to