aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/enum12.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/enum13.C20
3 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fa4549c..9cb673b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/enum12.C: New.
+ * g++.dg/cpp0x/enum13.C: New.
+
2011-05-21 Janus Weil <janus@gcc.gnu.org>
PR fortran/48699
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum12.C b/gcc/testsuite/g++.dg/cpp0x/enum12.C
new file mode 100644
index 0000000..b2ec919
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/enum12.C
@@ -0,0 +1,18 @@
+// PR c++/48780
+// { dg-options "-std=c++0x -fabi-version=0" }
+
+typedef __builtin_va_list __gnuc_va_list;
+typedef __gnuc_va_list va_list;
+
+enum struct A : short { X };
+
+void foo(int x, ...) {
+ va_list vl;
+ __builtin_va_start(vl, x);
+ enum A t = __builtin_va_arg(vl, enum A);
+ __builtin_va_end(vl);
+}
+
+int main() {
+ foo(0, A::X);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum13.C b/gcc/testsuite/g++.dg/cpp0x/enum13.C
new file mode 100644
index 0000000..ec02d3b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/enum13.C
@@ -0,0 +1,20 @@
+// PR c++/48780
+// { dg-options "-std=c++0x -fabi-version=5 -Wabi" }
+
+typedef __builtin_va_list __gnuc_va_list;
+typedef __gnuc_va_list va_list;
+
+enum struct A : short { X };
+
+void foo(int x, ...) {
+ va_list vl;
+ __builtin_va_start(vl, x);
+ enum A t = __builtin_va_arg(vl, enum A); // { dg-warning "promote" }
+ __builtin_va_end(vl);
+}
+
+int main() {
+ foo(0, A::X); // { dg-warning "will not promote" }
+}
+
+// { dg-prune-output "note" }