summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/initlist7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/initlist7.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist7.C12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist7.C b/gcc/testsuite/g++.dg/cpp0x/initlist7.C
new file mode 100644
index 000000000..7913ed7ed
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist7.C
@@ -0,0 +1,12 @@
+// PR c++/37932
+// { dg-options "-std=c++0x" }
+
+typedef enum { AA=1, BB=2 } my_enum;
+
+typedef struct { my_enum a:4 ; unsigned b:28; } stru;
+
+void foo (char c, my_enum x, int i)
+{
+ char arr[2] = {c+'0', 0}; // { dg-error "narrowing" }
+ stru s = {x,0};
+}