]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add fixed testcase [PR99804]
authorPatrick Palka <ppalka@redhat.com>
Wed, 25 Oct 2023 13:03:52 +0000 (09:03 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 25 Oct 2023 13:03:52 +0000 (09:03 -0400)
We accept the non-dependent call f(e) here ever since the
NON_DEPENDENT_EXPR removal patch r14-4793-gdad311874ac3b3.
I haven't looked closely into why but I suspect wrapping 'e'
in a NON_DEPENDENT_EXPR was causing the argument conversion
to misbehave.

PR c++/99804

gcc/testsuite/ChangeLog:

* g++.dg/template/enum9.C: New test.

gcc/testsuite/g++.dg/template/enum9.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/template/enum9.C b/gcc/testsuite/g++.dg/template/enum9.C
new file mode 100644 (file)
index 0000000..c992cd5
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/99804
+
+struct S {
+  enum E { A, B } e : 1;
+  void f(E);
+  template<class> void g() { f(e); }
+};
+
+int main() {
+  S s;
+  s.g<int>();
+}