fail_arrow.carbon 1.4 KB

12345678910111213141516171819202122232425262728
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/parse/testdata/namespace/fail_arrow.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_arrow.carbon
  10. namespace Foo;
  11. // CHECK:STDERR: fail_arrow.carbon:[[@LINE+3]]:10: ERROR: `class` declarations must either end with a `;` or have a `{ ... }` block for a definition.
  12. // CHECK:STDERR: class Foo->Bar {}
  13. // CHECK:STDERR: ^~
  14. class Foo->Bar {}
  15. // CHECK:STDOUT: - filename: fail_arrow.carbon
  16. // CHECK:STDOUT: parse_tree: [
  17. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  18. // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'},
  19. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'Foo'},
  20. // CHECK:STDOUT: {kind: 'Namespace', text: ';', subtree_size: 3},
  21. // CHECK:STDOUT: {kind: 'ClassIntroducer', text: 'class'},
  22. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'Foo'},
  23. // CHECK:STDOUT: {kind: 'ClassDecl', text: '}', has_error: yes, subtree_size: 3},
  24. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  25. // CHECK:STDOUT: ]