Support import Cpp; to import Cpp namespace for using C++ builtins (#6320)

This allows writing
```
import Cpp;
```

Instead of writing
```
import Cpp inline "";
```

Part of #6330.
This commit is contained in:
Boaz Brickner
2025-11-06 08:45:28 +00:00
committed by GitHub
parent ce109708bf
commit b54f2dd592
11 changed files with 110 additions and 33 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ static auto GenerateCppIncludesHeaderCode(
<< "\n";
// TODO: Inject a clang pragma here to produce an error if there are
// unclosed scopes at the end of this inline C++ fragment.
} else {
} else if (import.library_id.has_value()) {
// Translate `import Cpp library "foo.h";` into `#include "foo.h"`.
GenerateLineMarker(context, code_stream,
context.tokens().GetLineNumber(