public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-46] c++: Add fixed test [PR83596]
@ 2022-04-29 13:53 Marek Polacek
  0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2022-04-29 13:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1c798ab71e2b14cb60edeebc79e6a64f5aa88f4f

commit r13-46-g1c798ab71e2b14cb60edeebc79e6a64f5aa88f4f
Author: Marek Polacek <polacek@redhat.com>
Date:   Fri Apr 29 09:52:55 2022 -0400

    c++: Add fixed test [PR83596]
    
    This was fixed by r269078.
    
            PR c++/83596
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/cpp1z/nontype5.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/cpp1z/nontype5.C | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype5.C b/gcc/testsuite/g++.dg/cpp1z/nontype5.C
new file mode 100644
index 00000000000..7e6639dd175
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/nontype5.C
@@ -0,0 +1,11 @@
+// PR c++/83596
+// { dg-do compile { target c++17 } }
+
+struct X { int x; int y; };
+template <int X::* mp> int get(X& x) { return x.*mp; }
+constexpr int X::* getMP() { return &X::y; }
+constexpr int X::* mptr = getMP();
+int test() {
+    X x{1, 2};
+    return get<mptr>(x);
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-29 13:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 13:53 [gcc r13-46] c++: Add fixed test [PR83596] Marek Polacek

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).