We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
typeof
1 parent 107167a commit 505a247Copy full SHA for 505a247
2 files changed
vlib/v/gen/c/cgen.v
@@ -25,8 +25,8 @@ const c_reserved = ['asm', 'array', 'auto', 'bool', 'break', 'calloc', 'case', '
25
'exit', 'export', 'extern', 'false', 'float', 'for', 'free', 'goto', 'if', 'inline', 'int',
26
'link', 'long', 'malloc', 'namespace', 'new', 'nil', 'panic', 'register', 'restrict', 'return',
27
'short', 'signed', 'sizeof', 'static', 'string', 'struct', 'switch', 'typedef', 'typename',
28
- 'union', 'unix', 'unsigned', 'void', 'volatile', 'while', 'template', 'true', 'small', 'stdout',
29
- 'stdin', 'stderr', 'far', 'near', 'huge', 'requires']
+ 'typeof', 'union', 'unix', 'unsigned', 'void', 'volatile', 'while', 'template', 'true', 'small',
+ 'stdout', 'stdin', 'stderr', 'far', 'near', 'huge', 'requires']
30
const c_reserved_chk = token.new_keywords_matcher_from_array_trie(c_reserved)
31
// same order as in token.Kind
32
const cmp_str = ['eq', 'ne', 'gt', 'lt', 'ge', 'le']
vlib/v/tests/structs/struct_field_name_using_c_keyword_test.v
@@ -0,0 +1,9 @@
1
+struct Keywords {
2
+ typeof u8
3
+}
4
+
5
+fn test_struct_field_name_using_c_reserved() {
6
+ key := Keywords{}
7
+ println(key)
8
+ assert true
9
0 commit comments