Commit 13a7ca0
committed
test: be more flexible about anonymous enumeration imports
This test ensures that we correctly translate the anonymous enumeration
value. However, this is an odd case within the specification.
C11 6.7.2.2p2:
"The expression that defines the value of an enumeration constant shall
be an integer constant expression that has a value representable as an
`int`."
C11 6.7.2.2p4:
"Each enumerated type shall be compatible with `char`, a signed integer
type, or an unsigned integer type. The choice of type is
implementation-defined, but shall be capable of representing the values
of all the members of the enumeration."
C11 6.7.2.2p3:
"The identifiers in an enumerator list are declared as constants that
have type `int` and may appear wherever such are permitted."
Because the enumeration is anonymous, the value could never be written
as spelled. This type is imported as an `int` on Windows as per the ABI
and as an `unsigned long` on LP64 targets.1 parent aec5756 commit 13a7ca0
File tree
2 files changed
+10
-14
lines changed- test
- ClangImporter
- Inputs/clang-importer-sdk/usr/include
2 files changed
+10
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | | - | |
35 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
36 | 42 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 10 | + | |
18 | 11 | | |
19 | 12 | | |
20 | 13 | | |
21 | | - | |
22 | 14 | | |
23 | 15 | | |
24 | 16 | | |
| |||
0 commit comments