recover_prefix_repeat.carbon 1.5 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. // CHECK:STDERR: recover_prefix_repeat.carbon:[[@LINE+3]]:17: ERROR: Parentheses are required around this unary `const` operator.
  7. // CHECK:STDERR: fn F() -> const const i32* {
  8. // CHECK:STDERR: ^~~~~
  9. fn F() -> const const i32* {
  10. }
  11. // CHECK:STDOUT: - filename: recover_prefix_repeat.carbon
  12. // CHECK:STDOUT: parse_tree: [
  13. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  14. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  15. // CHECK:STDOUT: {kind: 'Name', text: 'F'},
  16. // CHECK:STDOUT: {kind: 'ParamListStart', text: '('},
  17. // CHECK:STDOUT: {kind: 'ParamList', text: ')', subtree_size: 2},
  18. // CHECK:STDOUT: {kind: 'IntegerTypeLiteral', text: 'i32'},
  19. // CHECK:STDOUT: {kind: 'PrefixOperator', text: 'const', subtree_size: 2},
  20. // CHECK:STDOUT: {kind: 'PrefixOperator', text: 'const', subtree_size: 3},
  21. // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 4},
  22. // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 5},
  23. // CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 10},
  24. // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 11},
  25. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  26. // CHECK:STDOUT: ]