public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114683] New: [modules] name declared in GMF in inline namespace and exported via using-decl from parent namespace is not visible to importer
@ 2024-04-10 20:22 m.cencora at gmail dot com
  2024-05-24 14:36 ` [Bug c++/114683] " nshead at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: m.cencora at gmail dot com @ 2024-04-10 20:22 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/114683] [modules] name declared in GMF in inline namespace and exported via using-decl from parent namespace is not visible to importer
  2024-04-10 20:22 [Bug c++/114683] New: [modules] name declared in GMF in inline namespace and exported via using-decl from parent namespace is not visible to importer m.cencora at gmail dot com
@ 2024-05-24 14:36 ` nshead at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-05-24 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-05-24
                 CC|                            |nshead at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Confirmed.  Another related testcase with a different kind of using-declaration
from PR114868:

  // 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;
  }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-24 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-10 20:22 [Bug c++/114683] New: [modules] name declared in GMF in inline namespace and exported via using-decl from parent namespace is not visible to importer m.cencora at gmail dot com
2024-05-24 14:36 ` [Bug c++/114683] " nshead at gcc dot gnu.org

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