llvm-project/clang/test/Frontend/diagnostic-pipe.c
Timm Baeder 718aac9f7a
[clang][Diagnostics] Highlight code snippets (#66514)
Add some primitive syntax highlighting to our code snippet output.

This adds "checkpoints" to the Preprocessor, which we can use to start lexing from. When printing a code snippet, we lex from the nearest checkpoint and highlight the tokens based on their token type.
2024-01-27 17:52:20 +01:00

10 lines
286 B
C

_Static_assert(0, "");
/// Test that piping the output into another process disables syntax
/// highlighting of code snippets.
// RUN: not %clang_cc1 %s -o /dev/null 2>&1 | FileCheck %s
// CHECK: error: static assertion failed:
// CHECK-NEXT: {{^}} 2 | _Static_assert(0, "");{{$}}