File: n2940.c

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (26 lines) | stat: -rw-r--r-- 1,081 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// RUN: %clang_cc1 -verify=no-trigraphs -std=c23 %s
// RUN: %clang_cc1 -verify=no-trigraphs -std=gnu23 %s
// RUN: %clang_cc1 -verify=no-trigraphs -std=gnu17 %s
// RUN: %clang_cc1 -verify=no-trigraphs -std=gnu11 %s
// RUN: %clang_cc1 -verify=no-trigraphs -std=gnu99 %s
// RUN: %clang_cc1 -verify=no-trigraphs -std=gnu89 %s
// RUN: %clang_cc1 -verify=trigraphs -std=c17 %s
// RUN: %clang_cc1 -verify=trigraphs -std=c11 %s
// RUN: %clang_cc1 -verify=trigraphs -std=c99 %s
// RUN: %clang_cc1 -verify=trigraphs -std=c89 %s
// RUN: %clang_cc1 -verify=trigraphs -std=c23 -ftrigraphs %s

/* WG14 N2940: Clang 18
 * Removing trigraphs??!
 */

// Trigraphs are enabled by default in any conforming C mode before C23, but
// are otherwise disabled (in all GNU modes, and in C23 or later).
// The ??= trigraph, if supported, will become the # character, which is a null
// preprocessor directive that does nothing.

??=
// no-trigraphs-warning@-1 {{trigraph ignored}} \
   no-trigraphs-error@-1 {{expected identifier or '('}} \
   trigraphs-warning@-1 {{trigraph converted to '#' character}}