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

            Bug ID: 49020
           Summary: Allowing brace elision even with desgnated
                    initializers
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

>From StackOverflow (https://stackoverflow.com/q/66000330/2069064):

struct A  {
    int a;
};

struct B {
    int b;
};

struct C {
    A a;
    B b;
};

C c{.a=0, .b={12}};

Clang accepts this program. But ".a=0" isn't a valid designated initializer,
you can't initialize an A with "=0". I think clang might be performing brace
elision here, which shouldn't apply to designated initializers.

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

Reply via email to