diff mbox series

[pushed] c++: add fixed testcase [PR99804]

Message ID 20231025130429.107577-1-ppalka@redhat.com
State New
Headers show
Series [pushed] c++: add fixed testcase [PR99804] | expand

Commit Message

Patrick Palka Oct. 25, 2023, 1:04 p.m. UTC
Tested on x86_64-pc-linux-gnu, pushed to trunk.

-- >8 --

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 | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/template/enum9.C
diff mbox series

Patch

diff --git a/gcc/testsuite/g++.dg/template/enum9.C b/gcc/testsuite/g++.dg/template/enum9.C
new file mode 100644
index 00000000000..c992cd505c2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/enum9.C
@@ -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>();
+}