nested.carbon 838 B

123456789101112131415161718192021222324252627282930
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/primitives.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/class/nested.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/class/nested.carbon
  12. // --- import_nested_class.carbon
  13. library "[[@TEST_NAME]]";
  14. import Cpp inline '''
  15. struct A {
  16. struct B {
  17. struct C {
  18. int abc;
  19. };
  20. };
  21. B::C c;
  22. };
  23. ''';
  24. fn F(p: Cpp.A*) -> i32 {
  25. return p->c.abc;
  26. }