* [pushed] c++: add fixed testcase [PR99804]
@ 2023-10-25 13:04 Patrick Palka
0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2023-10-25 13:04 UTC (permalink / raw)
To: gcc-patches; +Cc: jason, Patrick Palka
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 --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>();
+}
--
2.42.0.482.g2e8e77cbac
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-10-25 13:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25 13:04 [pushed] c++: add fixed testcase [PR99804] Patrick Palka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).