summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp')
-rw-r--r--Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp b/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp
new file mode 100644
index 0000000..63a3713
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp
@@ -0,0 +1,9 @@
+
+struct X { int i, j, k = 42; };
+
+int someFunc()
+{
+ X a[] = { 1, 2, 3, 4, 5, 6 };
+ X b[2] = { { 1, 2, 3 }, { 4, 5, 6 } };
+ return a[0].k == b[0].k && a[1].k == b[1].k ? 0 : 1;
+}