DR 685 - Integral promotion of enum ignores fixed underlying type.
authorMarek Polacek <polacek@redhat.com>
Tue, 8 Oct 2019 16:26:39 +0000 (16:26 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 8 Oct 2019 16:26:39 +0000 (16:26 +0000)
* g++.dg/cpp0x/scoped_enum9.C: New test.

From-SVN: r276705

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/scoped_enum9.C [new file with mode: 0644]

index 895c06f..f3da169 100644 (file)
@@ -1,3 +1,8 @@
+2019-10-08  Marek Polacek  <polacek@redhat.com>
+
+       DR 685 - Integral promotion of enum ignores fixed underlying type.
+       * g++.dg/cpp0x/scoped_enum9.C: New test.
+
 2019-10-08  Martin Sebor  <msebor@redhat.com>
 
        PR tetsuite/92025
diff --git a/gcc/testsuite/g++.dg/cpp0x/scoped_enum9.C b/gcc/testsuite/g++.dg/cpp0x/scoped_enum9.C
new file mode 100644 (file)
index 0000000..f38f26d
--- /dev/null
@@ -0,0 +1,11 @@
+// DR 685 - Integral promotion of enumeration ignores fixed underlying type.
+// { dg-do compile { target c++11 } }
+
+enum E: long { e };
+
+void f(int);
+int f(long);
+
+void g() {
+  int k = f(e);
+}