public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-10730] Revert "c++: friend with redundant qualification [PR41723]"
@ 2022-05-12 22:24 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-05-12 22:24 UTC (permalink / raw)
  To: gcc-cvs

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

commit r10-10730-gc2e39b9e1568484192c3a4c2b4425b06e701a3fe
Author: Jason Merrill <jason@redhat.com>
Date:   Thu May 12 17:08:52 2022 -0400

    Revert "c++: friend with redundant qualification [PR41723]"
    
            PR c++/102300
            PR c++/41723
    
    The patch for PR41723 caused PR102300 on trunk; let's just back it out on
    the 10 branch.
    
    This reverts commit e41d610696b81e72d1d06db176b281424e32fc23.
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/template/nested7.C: New test.

Diff:
---
 gcc/cp/parser.c                          |  2 +-
 gcc/testsuite/g++.dg/template/friend71.C |  8 --------
 gcc/testsuite/g++.dg/template/nested7.C  | 12 ++++++++++++
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 1499bf5d258..4c36cbeeb48 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -23674,7 +23674,7 @@ cp_parser_class_name (cp_parser *parser,
   /* Any name names a type if we're following the `typename' keyword
      in a qualified name where the enclosing scope is type-dependent.  */
   typename_p = (typename_keyword_p && scope && TYPE_P (scope)
-		&& dependent_scope_p (scope));
+		&& dependent_type_p (scope));
   /* Handle the common case (an identifier, but not a template-id)
      efficiently.  */
   if (token->type == CPP_NAME
diff --git a/gcc/testsuite/g++.dg/template/friend71.C b/gcc/testsuite/g++.dg/template/friend71.C
deleted file mode 100644
index 939ea6b5264..00000000000
--- a/gcc/testsuite/g++.dg/template/friend71.C
+++ /dev/null
@@ -1,8 +0,0 @@
-// PR c++/41723
-
-template<class T>
-class C {
-  template <class U> class D {};
-
-  friend class C::D<int>;
-};
diff --git a/gcc/testsuite/g++.dg/template/nested7.C b/gcc/testsuite/g++.dg/template/nested7.C
new file mode 100644
index 00000000000..3a5930c0f31
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/nested7.C
@@ -0,0 +1,12 @@
+// PR c++/102300
+
+template<typename T>
+struct holder
+{
+  template<typename F> struct fn {};
+
+  struct t1 : fn<T> {};                      // pass
+  struct t2 : holder<T >::fn<T> {};          // fail
+  struct t3 : holder<T >::template fn<T> {}; // fail
+  struct t4 : holder<T*>::template fn<T> {}; // pass
+};


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

only message in thread, other threads:[~2022-05-12 22:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 22:24 [gcc r10-10730] Revert "c++: friend with redundant qualification [PR41723]" Jason Merrill

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