public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-modules] Stream MEM_REFs, who knew?
@ 2020-08-27 20:18 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2020-08-27 20:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:28d02ccd11280c348311331561101fb37ff05c8c

commit 28d02ccd11280c348311331561101fb37ff05c8c
Author: Nathan Sidwell <nathan@acm.org>
Date:   Thu Aug 27 12:49:36 2020 -0700

    Stream MEM_REFs, who knew?
    
            gcc/cp/
            * module.cc (trees_{in,out}::start): Permit MEM_REFs.
            (trees_{in,out}::core_bools): Likewise.
            gcc/testsuite/
            * g++.dg/modules/memref-1_[ab].C: New.

Diff:
---
 ChangeLog.modules                         |  9 +++++++++
 gcc/cp/module.cc                          |  4 ----
 gcc/testsuite/g++.dg/modules/memref-1_a.C | 24 ++++++++++++++++++++++++
 gcc/testsuite/g++.dg/modules/memref-1_b.C |  9 +++++++++
 4 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/ChangeLog.modules b/ChangeLog.modules
index 27233f0228d..bf3db083544 100644
--- a/ChangeLog.modules
+++ b/ChangeLog.modules
@@ -1,3 +1,12 @@
+2020-08-27  Nathan Sidwell  <nathan@acm.org>
+
+	Stream MEM_REFs, who knew?
+	gcc/cp/
+	* module.cc (trees_{in,out}::start): Permit MEM_REFs.
+	(trees_{in,out}::core_bools): Likewise.
+	gcc/testsuite/
+	* g++.dg/modules/memref-1_[ab].C: New.
+
 2020-08-27  Nathan Sidwell  <nathan@acm.org>
 	    Jeff Chapman II  <jchapman@lock3software.com>
 
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 17c3fad89dd..f94d28fb120 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -5053,7 +5053,6 @@ trees_out::start (tree t, bool code_streamed)
       break;
 
     case IDENTIFIER_NODE:
-    case MEM_REF:
     case SSA_NAME:
     case TARGET_MEM_REF:
     case TRANSLATION_UNIT_DECL:
@@ -5136,7 +5135,6 @@ trees_in::start (unsigned code)
 
     case FIXED_CST:
     case IDENTIFIER_NODE:
-    case MEM_REF:
     case POLY_INT_CST:
     case SSA_NAME:
     case TARGET_MEM_REF:
@@ -5186,7 +5184,6 @@ trees_out::core_bools (tree t)
     {
     case CALL_EXPR:
     case INTEGER_CST:
-    case MEM_REF:
     case SSA_NAME:
     case TARGET_MEM_REF:
     case TREE_VEC:
@@ -5364,7 +5361,6 @@ trees_in::core_bools (tree t)
     {
     case CALL_EXPR:
     case INTEGER_CST:
-    case MEM_REF:
     case SSA_NAME:
     case TARGET_MEM_REF:
     case TREE_VEC:
diff --git a/gcc/testsuite/g++.dg/modules/memref-1_a.C b/gcc/testsuite/g++.dg/modules/memref-1_a.C
new file mode 100644
index 00000000000..e780999778d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/memref-1_a.C
@@ -0,0 +1,24 @@
+// { dg-additional-options -fmodules-ts }
+
+export module Foo;
+// { dg-module-cmi Foo }
+
+export class Bit
+{
+private:
+  unsigned _M_msb:1;
+};
+
+Bit Make () noexcept;
+
+export class Container
+{
+public:
+  void Frob ()
+  {
+    _M_rep = Make ();
+  }
+  
+private:
+  Bit _M_rep;
+};
diff --git a/gcc/testsuite/g++.dg/modules/memref-1_b.C b/gcc/testsuite/g++.dg/modules/memref-1_b.C
new file mode 100644
index 00000000000..82c52faed7a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/memref-1_b.C
@@ -0,0 +1,9 @@
+// { dg-additional-options -fmodules-ts }
+
+import Foo;
+
+void X ()
+{
+  Container c;
+  c.Frob ();
+}


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

only message in thread, other threads:[~2020-08-27 20:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 20:18 [gcc/devel/c++-modules] Stream MEM_REFs, who knew? Nathan Sidwell

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