mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
* `\x` escapes are not permitted in character literals * ASCII control characters (U+0000 .. U+001F) are not permitted in character literals unless specified with escape sequences.
118 lines
6.2 KiB
Plaintext
118 lines
6.2 KiB
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_char_literals_bad_encoding.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_char_literals_bad_encoding.carbon
|
|
// CHECK:STDOUT: - filename: fail_char_literals_bad_encoding.carbon
|
|
// CHECK:STDOUT: tokens:
|
|
|
|
// Be careful when operating on this file: it contains invalid UTF-8 sequences
|
|
// and Unicode control characters, and text editors are likely to corrupt it.
|
|
|
|
// The next literal contains 0x00.
|
|
// CHECK:STDERR: fail_char_literals_bad_encoding.carbon:[[@LINE+4]]:1: error: control character in character literal; specify as escape sequence `\u{00}` [CharLiteralControlCharacter]
|
|
// CHECK:STDERR: ' |