public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Patrick Palka <ppalka@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9035] c++: add fixed testcase [PR111682]
Date: Fri, 16 Feb 2024 17:45:01 +0000 (GMT)	[thread overview]
Message-ID: <20240216174501.628CF385800C@sourceware.org> (raw)

https://gcc.gnu.org/g:c95dc611a6203f0564722975acff4ad866b9c45e

commit r14-9035-gc95dc611a6203f0564722975acff4ad866b9c45e
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Feb 16 12:44:27 2024 -0500

    c++: add fixed testcase [PR111682]
    
    Fixed by the PR113612 fix r14-8960-g19ac327de421fe.
    
            PR c++/111682
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/cpp1y/var-templ86.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/cpp1y/var-templ86.C | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ86.C b/gcc/testsuite/g++.dg/cpp1y/var-templ86.C
new file mode 100644
index 000000000000..0c933cac26c2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ86.C
@@ -0,0 +1,23 @@
+// PR c++/111682
+// { dg-do compile { target c++14 } }
+
+template<typename T> struct A {
+  template<typename U> struct B;
+  template<typename U> struct B<U*>;
+};
+template<typename T> template<typename U> struct A<T>::B<U*> {};
+template struct A<int>;
+A<int>::B<int*> b;
+
+
+template<typename T> struct B {
+  template<typename U> static const int var1;
+  template<typename U> static const int var1<U*>;
+
+  template<typename U> static const int var2;
+};
+template<typename T> template<typename U> const int B<T>::var1<U*> = 1;
+template<typename T> template<typename U> const int B<T>::var2<U*> = 1;
+template struct B<int>;
+int b_test1[B<int>::var1<int*>];
+int b_test2[B<int>::var2<int*>];

                 reply	other threads:[~2024-02-16 17:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240216174501.628CF385800C@sourceware.org \
    --to=ppalka@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).