[llvm-bugs] [Bug 47694] New: C++20 Designated Initializers - Nested initialization
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Sep 30 08:45:56 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=47694
Bug ID: 47694
Summary: C++20 Designated Initializers - Nested initialization
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++2a
Assignee: unassignedclangbugs at nondot.org
Reporter: cai at synopsys.com
CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk
Hi,
This code snippet is taken from P0329R4.
struct A
{
int x;
};
struct B
{
A a;
};
int main()
{
B b{.a.x = 0};
return 0;
}
GCC fails to compile this example, which should be invalid according to the
C++20 standard.
GCC error:
error: expected primary-expression before '.' token
13 | B b{.a.x = 0};
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200930/faf7e647/attachment.html>
More information about the llvm-bugs
mailing list