/* FIXME: Handle exporting declarations from a different scope
without also marking those declarations as exported.
This will require not just binding directly to the underlying
- value; see c++/114863 and c++/114865. We allow this for purview
- declarations for now as this doesn't (currently) cause ICEs
+ value; see c++/114683 and c++/114685. We allow the extra exports
+ for now as this doesn't (currently) cause ICEs
later down the line, but this should be revisited. */
if (revealing_p)
{
if (module_exporting_p ()
&& check_can_export_using_decl (lookup.value)
- && lookup.value == value
&& !DECL_MODULE_EXPORT_P (lookup.value))
{
/* We're redeclaring the same value, but this time as
--- /dev/null
+// PR c++/114683
+// { dg-additional-options "-fmodules-ts -Wno-global-module" }
+
+module;
+
+namespace std
+{
+ inline namespace __cxx11
+ {
+ template <typename T>
+ struct basic_string{};
+ }
+}
+
+namespace foo {
+ using std::basic_string;
+}
+
+export module std;
+
+export namespace std
+{
+ using std::basic_string;
+}
--- /dev/null
+// { dg-additional-options "-fmodules-ts" }
+
+import std;
+
+int main()
+{
+ std::basic_string<char> s;
+
+ // The inline namespace should not be exported, only the 'using' in std.
+ std::__cxx11::basic_string<char> s2; // { dg-error "has not been declared" "" { xfail *-*-* } }
+ // The non-exported using should also not be visible.
+ foo::basic_string<char> s3; // { dg-error "has not been declared" "" { xfail *-*-* } }
+}