Skip to content

Can't use UDL of std::string with import std; #72427

Closed
@JohelEGP

Description

@JohelEGP

With https://libcxx.llvm.org/Modules.html#using-in-external-projects,
the following program fails:

export module main;
import std;
using namespace std::string_literals;
main.cpp:3:22: error: missing '#include <string>'; 'string_literals' must be declared before it is used
    3 | using namespace std::string_literals;
      |                      ^
/home/johel/Documents/C++/Forks/llvm/libcxx-std-modules/include/c++/v1/string:4387:20: note: declaration here is not visible
 4387 |   inline namespace string_literals
      |                    ^
1 error generated.

Metadata

Metadata

Assignees

Labels

clang:modulesC++20 modules and Clang Header Moduleslibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions