public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-9511] Revert "c++: DMI in template with virtual base [PR106890]"
@ 2023-05-04 14:48 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2023-05-04 14:48 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:13a269a015f888a0001af7b9ab564fadbee4a808
commit r12-9511-g13a269a015f888a0001af7b9ab564fadbee4a808
Author: Jason Merrill <jason@redhat.com>
Date: Thu May 4 10:26:25 2023 -0400
Revert "c++: DMI in template with virtual base [PR106890]"
The PR106890 patch caused PR109666; for 12.3 let's just revert it.
PR c++/109666
This reverts commit 94569d91bd4c604da755b4aae84256e7fe21196a.
Diff:
---
gcc/cp/init.cc | 14 --------------
gcc/testsuite/g++.dg/cpp0x/nsdmi-template25.C | 18 ------------------
2 files changed, 32 deletions(-)
diff --git a/gcc/cp/init.cc b/gcc/cp/init.cc
index 92969857ea8..75dbfe112b5 100644
--- a/gcc/cp/init.cc
+++ b/gcc/cp/init.cc
@@ -613,18 +613,6 @@ maybe_instantiate_nsdmi_init (tree member, tsubst_flags_t complain)
pushed = true;
}
- /* If we didn't push_to_top_level, still step out of constructor
- scope so build_base_path doesn't try to use its __in_chrg. */
- tree cfd = current_function_decl;
- auto cbl = current_binding_level;
- if (at_function_scope_p ())
- {
- current_function_decl
- = decl_function_context (current_function_decl);
- while (current_binding_level->kind != sk_class)
- current_binding_level = current_binding_level->level_chain;
- }
-
inject_this_parameter (ctx, TYPE_UNQUALIFIED);
start_lambda_scope (member);
@@ -643,8 +631,6 @@ maybe_instantiate_nsdmi_init (tree member, tsubst_flags_t complain)
if (init != error_mark_node)
hash_map_safe_put<hm_ggc> (nsdmi_inst, member, init);
- current_function_decl = cfd;
- current_binding_level = cbl;
if (pushed)
{
pop_deferring_access_checks ();
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template25.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template25.C
deleted file mode 100644
index 368e745540e..00000000000
--- a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template25.C
+++ /dev/null
@@ -1,18 +0,0 @@
-// PR c++/106890
-// { dg-do compile { target c++11 } }
-
-struct A
-{
- int p;
-};
-
-template<typename T>
-struct B : virtual public A
-{
- B() { }
- B(int) { }
-
- int k = this->p;
-};
-
-template struct B<int>;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-04 14:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04 14:48 [gcc r12-9511] Revert "c++: DMI in template with virtual base [PR106890]" 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).