public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-283] c++: restore instantiate_decl assert
@ 2023-04-27  1:46 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2023-04-27  1:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:95d4c0d2e6318aef88ba0bc607dfc1ec6b7a612f

commit r14-283-g95d4c0d2e6318aef88ba0bc607dfc1ec6b7a612f
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Mar 16 16:55:39 2023 -0400

    c++: restore instantiate_decl assert
    
    For PR61445 I removed this assert, but PR108242 demonstrated why it's still
    useful; to avoid regressing the former testcase I check pattern_defined
    in the assert.
    
    This reverts r212524.
    
            PR c++/61445
    
    gcc/cp/ChangeLog:
    
            * pt.cc (instantiate_decl): Assert !defer_ok for local
            class members.

Diff:
---
 gcc/cp/pt.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 93a055c66a1..6df16fef0dd 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -27090,6 +27090,12 @@ instantiate_decl (tree d, bool defer_ok, bool expl_inst_class_mem_p)
 	pattern_defined = ! DECL_EXTERNAL (code_pattern);
     }
 
+  /* Any local class members should be instantiated from the TAG_DEFN
+     with defer_ok == 0.  */
+  gcc_checking_assert (!defer_ok || !pattern_defined
+		       || !decl_function_context (d)
+		       || LAMBDA_TYPE_P (DECL_CONTEXT (d)));
+
   /* We may be in the middle of deferred access check.  Disable it now.  */
   push_deferring_access_checks (dk_no_deferred);

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

only message in thread, other threads:[~2023-04-27  1:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27  1:46 [gcc r14-283] c++: restore instantiate_decl assert 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).