1
0
Fork 0
forked from fte/fteqw

Fix assignment to static class members const issue.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5648 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2020-03-14 17:31:17 +00:00
parent 4beaf0e0c8
commit d0b7519242

View file

@ -5535,7 +5535,7 @@ QCC_type_t *QCC_PR_ParseType (int newtype, pbool silentfail)
} }
else else
{ {
if (isvirt|isnonvirt) if (isvirt||isnonvirt)
QCC_Error(ERR_INTERNAL, "virtual keyword on member that is not a function"); QCC_Error(ERR_INTERNAL, "virtual keyword on member that is not a function");
} }
@ -5672,8 +5672,12 @@ QCC_type_t *QCC_PR_ParseType (int newtype, pbool silentfail)
//static members are technically just funny-named globals, and do not generate fields. //static members are technically just funny-named globals, and do not generate fields.
if (isnonvirt || isstatic || (newparm->type == ev_function && !arraysize)) if (isnonvirt || isstatic || (newparm->type == ev_function && !arraysize))
{ {
unsigned int fl = 0;
if (newparm->type == ev_function && !arraysize)
fl = GDF_CONST;
QC_snprintfz(membername, sizeof(membername), "%s::%s", classname, parmname); QC_snprintfz(membername, sizeof(membername), "%s::%s", classname, parmname);
QCC_FreeDef(QCC_PR_GetDef(newparm, membername, NULL, true, 0, GDF_CONST)); QCC_FreeDef(QCC_PR_GetDef(newparm, membername, NULL, true, 0, fl));
if (isnonvirt || isstatic) if (isnonvirt || isstatic)
continue; continue;