[Bug c++/114868] [modules] func declared in GMF and exported via using-decl in module partition is not actually exported

2024-05-24 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114868

Nathaniel Shead  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #4 from Nathaniel Shead  ---
And fixed for GCC 14.2.

[Bug c++/114868] [modules] func declared in GMF and exported via using-decl in module partition is not actually exported

2024-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114868

--- Comment #3 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Nathaniel Shead
:

https://gcc.gnu.org/g:782ad2033ea0709a25ef3e899cbb9491406146d5

commit r14-10241-g782ad2033ea0709a25ef3e899cbb9491406146d5
Author: Nathaniel Shead 
Date:   Tue Apr 9 21:49:58 2024 +1000

c++: Propagate using decls from partitions [PR114868]

The modules code currently neglects to set OVL_USING_P on the dependency
created for a using-decl, which causes it not to remember that the
OVL_EXPORT_P flag had been set on it when emitted from the primary
interface unit. This patch ensures that it occurs.

PR c++/114868

gcc/cp/ChangeLog:

* module.cc (depset::hash::add_binding_entity): Propagate
OVL_USING_P for using-declarations.

gcc/testsuite/ChangeLog:

* g++.dg/modules/using-15_a.C: New test.
* g++.dg/modules/using-15_b.C: New test.
* g++.dg/modules/using-15_c.C: New test.

Signed-off-by: Nathaniel Shead 
(cherry picked from commit 0d0215b10dbbe39d655ceda4af283f288ec7680c)

[Bug c++/114868] [modules] func declared in GMF and exported via using-decl in module partition is not actually exported

2024-05-01 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114868

Nathaniel Shead  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |nshead at gcc dot 
gnu.org
 CC||nshead at gcc dot gnu.org
   Target Milestone|--- |14.2
   Last reconfirmed||2024-05-01
 Status|UNCONFIRMED |ASSIGNED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=114683

--- Comment #2 from Nathaniel Shead  ---
Fixed for GCC 15 so far.  Non-functions don't always work, which is largely
tracked in PR c++/114683. We also might not correctly differentiate unscoped
enums from using enum declarations for this purpose, but it's hard to tell
before PR114683 is fixed.

For instance:


  // using_enum_a.cpp
  module;
  namespace foo {
enum class a { x, y, z };
  }
  export module M:a;
  namespace bar {
export using enum foo::a;
  }

  // using_enum_b.cpp
  export module M;
  export import :a;

  // using_enum_c.cpp
  import M;
  int main() {
auto x = bar::x;
  }

[Bug c++/114868] [modules] func declared in GMF and exported via using-decl in module partition is not actually exported

2024-05-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114868

--- Comment #1 from GCC Commits  ---
The master branch has been updated by Nathaniel Shead :

https://gcc.gnu.org/g:0d0215b10dbbe39d655ceda4af283f288ec7680c

commit r15-85-g0d0215b10dbbe39d655ceda4af283f288ec7680c
Author: Nathaniel Shead 
Date:   Tue Apr 9 21:49:58 2024 +1000

c++: Propagate using decls from partitions [PR114868]

The modules code currently neglects to set OVL_USING_P on the dependency
created for a using-decl, which causes it not to remember that the
OVL_EXPORT_P flag had been set on it when emitted from the primary
interface unit. This patch ensures that it occurs.

PR c++/114868

gcc/cp/ChangeLog:

* module.cc (depset::hash::add_binding_entity): Propagate
OVL_USING_P for using-declarations.

gcc/testsuite/ChangeLog:

* g++.dg/modules/using-15_a.C: New test.
* g++.dg/modules/using-15_b.C: New test.
* g++.dg/modules/using-15_c.C: New test.

Signed-off-by: Nathaniel Shead