https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114683

            Bug ID: 114683
           Summary: [modules] name declared in GMF in inline namespace and
                    exported via using-decl from parent namespace is not
                    visible to importer
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: m.cencora at gmail dot com
  Target Milestone: ---

$ cat std.cpp
module;

#include "std.h"

export module std;

export namespace std
{
#ifdef WORKAROUND
inline namespace __cxx11
{
using std::__cxx11::basic_string;
}
#else
using std::basic_string;
#endif
}

$ cat std.h
#pragma once

namespace std
{
inline namespace __cxx11
{
template <typename T>
struct basic_string{};
}
}

$ cat std_user.cpp 
import std;

int main()
{
using std::basic_string;
}

$ g++ -std=c++2b -fmodules-ts std.cpp std_user.cpp
std_user.cpp: In function ‘int main()’:
std_user.cpp:5:12: error: ‘basic_string’ has not been declared in ‘std’

Works fine on clang.
Reduced from standard library headers.

Reply via email to