Commit: patch 9.1.2022: using C++ keyword class as member variable name

2 views
Skip to first unread message

Christian Brabandt

unread,
Dec 26, 2025, 11:01:00 AM (yesterday) Dec 26
to vim...@googlegroups.com
patch 9.1.2022: using C++ keyword class as member variable name

Commit: https://github.com/vim/vim/commit/43b87938f5f4b1322607142dcccdbe20d5259ad6
Author: Wei Tang <gauc...@uestc.edu.cn>
Date: Fri Dec 26 15:54:46 2025 +0000

patch 9.1.2022: using C++ keyword class as member variable name

Problem: A recent commit introduced a member variable named `class` in
the `exarg` structure, which conflicts with the C++ keyword
`class`. This causes compilation issues on Windows when VIM
is compiled with OLE enabled, as "if_ole.cpp" cannot compile
due to the keyword conflict (after v9.1.2012).
Solution: Rename the member variable of `exarg` from `class` to `ea_class`.
(Wei Tang)

related: #18949
closes: #19016

Signed-off-by: Wei Tang <gauc...@uestc.edu.cn>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/eval.c b/src/eval.c
index d7ce2a17e..75418c449 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -131,7 +131,7 @@ fill_evalarg_from_eap(evalarg_T *evalarg, exarg_T *eap, int skip)
evalarg->eval_getline = eap->ea_getline;
evalarg->eval_cookie = eap->cookie;
}
- evalarg->eval_class = eap->class;
+ evalarg->eval_class = eap->ea_class;
}

/*
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 638a5faa9..8eda9ccee 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -1973,7 +1973,7 @@ struct exarg
void *cookie; // argument for getline()
#ifdef FEAT_EVAL
cstack_T *cstack; // condition stack for ":if" etc.
- class_T *class; // Name of class being defined. Used by :class
+ class_T *ea_class; // Name of class being defined. Used by :class
// and :enum commands.
#endif
};
diff --git a/src/version.c b/src/version.c
index 00146a0a5..c88bff30a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2022,
/**/
2021,
/**/
diff --git a/src/vim9class.c b/src/vim9class.c
index 11b4c43f5..9d0521a42 100644
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -2122,7 +2122,7 @@ early_ret:
cl->class_object_type.tt_type = VAR_OBJECT;
cl->class_object_type.tt_class = cl;

- eap->class = cl;
+ eap->ea_class = cl;

// Add the class to the script-local variables.
// TODO: handle other context, e.g. in a function
Reply all
Reply to author
Forward
0 new messages