mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Reverse Interop: Nested namespace support (#6940)
Start recording the clang::DeclContext* -> InstId mapping for use in later operations. The test update includes removing the initial fail_* test because I hadn't thought about the use of namespace aliases as a way to test for the presence of a namespace without the failure caused by not finding the thing inside the namespace. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
f9e1806c4a
commit
2af5f971da
+4
-15
@@ -10,23 +10,10 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/reverse/simple.carbon
|
||||
|
||||
// --- fail_simple.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// Demonstrate that the 'Carbon' namespace has been injected into the C++ compilation.
|
||||
|
||||
import Cpp inline '''
|
||||
// CHECK:STDERR: fail_simple.carbon:[[@LINE+4]]:9: error: no type named 'NonExistent' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 11 | Carbon::NonExistent v;
|
||||
// CHECK:STDERR: | ~~~~~~~~^
|
||||
// CHECK:STDERR:
|
||||
Carbon::NonExistent v;
|
||||
''';
|
||||
|
||||
|
||||
// --- other.carbon
|
||||
package Other;
|
||||
namespace Nested;
|
||||
namespace Nested.Again;
|
||||
// --- namespace.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
@@ -34,4 +21,6 @@ library "[[@TEST_NAME]]";
|
||||
import Other;
|
||||
import Cpp inline '''
|
||||
namespace X = Carbon::Other;
|
||||
namespace Y = Carbon::Other::Nested;
|
||||
namespace Z = Carbon::Other::Nested::Again;
|
||||
''';
|
||||
|
||||
Reference in New Issue
Block a user