diff options
author | Jason Merrill <jason@redhat.com> | 2024-06-12 00:13:45 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2024-06-12 16:30:07 -0400 |
commit | f8356d66cfbda1e65536016d3049342a43f6af63 (patch) | |
tree | d498c1ab16a66e60f1782b3f8d162174076c209b /gcc/cp/module.cc | |
parent | 7bf072e87a03c9eaff9b7a1ac182537b70f0ba8e (diff) | |
download | gcc-f8356d66cfbda1e65536016d3049342a43f6af63.zip gcc-f8356d66cfbda1e65536016d3049342a43f6af63.tar.gz gcc-f8356d66cfbda1e65536016d3049342a43f6af63.tar.bz2 |
c++: module std and exception_ptr
exception_ptr.h contains
namespace __exception_ptr
{
class exception_ptr;
}
using __exception_ptr::exception_ptr;
so when module std tries to 'export using std::exception_ptr', it names
another using-directive rather than the class directly, so __exception_ptr
is never explicitly opened in module purview.
gcc/cp/ChangeLog:
* module.cc (depset::hash::add_binding_entity): Set
DECL_MODULE_PURVIEW_P instead of asserting.
gcc/testsuite/ChangeLog:
* g++.dg/modules/using-20_a.C: New test.
Diffstat (limited to 'gcc/cp/module.cc')
-rw-r--r-- | gcc/cp/module.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 21fc851..72e876c 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -13253,8 +13253,11 @@ depset::hash::add_binding_entity (tree decl, WMB_Flags flags, void *data_) data->met_namespace = true; if (data->hash->add_namespace_entities (decl, data->partitions)) { - /* It contains an exported thing, so it is exported. */ - gcc_checking_assert (DECL_MODULE_PURVIEW_P (decl)); + /* It contains an exported thing, so it is exported. + We used to assert DECL_MODULE_PURVIEW_P, but that fails for a + namespace like std::__exception_ptr which is never opened in + module purview; the exporting using finds another using. */ + DECL_MODULE_PURVIEW_P (decl) = true; DECL_MODULE_EXPORT_P (decl) = true; } |