On 6/13/24 11:16, Patrick Palka wrote:
On Wed, 12 Jun 2024, Jason Merrill wrote:
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.
FWIW PR100134 ICEd in the same way, and r13-3236-g9736a42e1fb8df
narrowly fixed this by setting DECL_MODULE_PURVIEW_P on the enclosing
namespace around the time we set the flag on the namespace-scope entity in
question. I wonder if it'd be preferable to do something similar here,
e.g. set DECL_MODULE_PURVIEW_P on the enclosing namespace in
do_nonmember_using_decl?
Interesting thought, but I don't think so, as this is a workaround for
the broader 114683 problem; we shouldn't actually be setting
DECL_MODULE_PURVIEW_P on the class, either, only the using-declaration.
The problem is that we don't currently represent the using in a way that
we can set flags on specifically.
Jason