From: Patrick Palka Date: Wed, 25 Oct 2023 13:03:52 +0000 (-0400) Subject: c++: add fixed testcase [PR99804] X-Git-Tag: basepoints/gcc-15~5215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb28d5c6b0a47ab704290d0122f978d1e6346551;p=thirdparty%2Fgcc.git c++: add fixed testcase [PR99804] 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. --- diff --git a/gcc/testsuite/g++.dg/template/enum9.C b/gcc/testsuite/g++.dg/template/enum9.C new file mode 100644 index 000000000000..c992cd505c2f --- /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 void g() { f(e); } +}; + +int main() { + S s; + s.g(); +}