-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use UDL of std::string
with import std;
#72427
Comments
@llvm/issue-subscribers-clang-modules Author: Johel Ernesto Guerrero Peña (JohelEGP)
With <https://libcxx.llvm.org/Modules.html#using-in-external-projects>,
the following program fails:
```C++
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.
```
|
I am wondering if this is a libc++'s issue. I've checked that in modules/std/string.inc, only the namespace |
|
Got it. I'll try to take a look. |
After I took more experiment in the library level, I feel this is a library issue more. First, it is not a problem to Then for
It looks like the Finally, I add the namespaces manually in string.inc:
Then For |
The fix changes the way the validation script determines the qualified name of a declaration. Inline namespaces without a reserved name are now always part of the name. The Clang code only does this when the names are ambigious. This method is often used for the operator""foo for UDLs. Adjusted the newly flagged issue and removed a work-around in the test code that is no longer required. Fixes llvm#72427
The fix changes the way the validation script determines the qualified name of a declaration. Inline namespaces without a reserved name are now always part of the name. The Clang code only does this when the names are ambigious. This method is often used for the operator""foo for UDLs. Adjusted the newly flagged issue and removed a work-around in the test code that is no longer required. Fixes #72427
The fix changes the way the validation script determines the qualified name of a declaration. Inline namespaces without a reserved name are now always part of the name. The Clang code only does this when the names are ambigious. This method is often used for the operator""foo for UDLs. Adjusted the newly flagged issue and removed a work-around in the test code that is no longer required. Fixes llvm/llvm-project#72427 NOKEYCHECK=True GitOrigin-RevId: 7d34f8c09ee17327668c337ff3a7c30656f8daca
With https://libcxx.llvm.org/Modules.html#using-in-external-projects,
the following program fails:
The text was updated successfully, but these errors were encountered: