@@ -891,6 +891,7 @@ static void resetglobals(void)
891
891
fcurrent = 0 ; /* current file being processed (debugging) */
892
892
sc_intest = FALSE; /* true if inside a test */
893
893
pc_sideeffect = 0 ; /* true if an expression causes a side-effect */
894
+ pc_ovlassignment = FALSE;/* true if an expression contains an overloaded assignment */
894
895
stmtindent = 0 ; /* current indent of the statement */
895
896
indent_nowarn = FALSE; /* do not skip warning "217 loose indentation" */
896
897
sc_allowtags = TRUE; /* allow/detect tagnames */
@@ -2380,7 +2381,7 @@ static int declloc(int fstatic)
2380
2381
lval .ident = iVARIABLE ;
2381
2382
lval .constval = 0 ;
2382
2383
lval .tag = tag ;
2383
- check_userop (NULL ,ctag ,lval .tag ,2 ,NULL ,& ctag );
2384
+ suppress_w240 |= check_userop (NULL ,ctag ,lval .tag ,2 ,NULL ,& ctag );
2384
2385
store (& lval );
2385
2386
markexpr (sEXPR ,NULL ,0 ); /* full expression ends after the store */
2386
2387
assert (staging ); /* end staging phase (optimize expression) */
@@ -2426,6 +2427,8 @@ static int declloc(int fstatic)
2426
2427
} /* if */
2427
2428
if (explicit_init )
2428
2429
markinitialized (sym ,!suppress_w240 );
2430
+ if (pc_ovlassignment )
2431
+ sym -> usage |= uREAD ;
2429
2432
} while (matchtoken (',' )); /* enddo */ /* more? */
2430
2433
needtoken (tTERM ); /* if not comma, must be semicolumn */
2431
2434
return ident ;
@@ -5535,6 +5538,7 @@ static int doexpr(int comma,int chkeffect,int allowarray,int mark_endexpr,
5535
5538
if (index != stgidx )
5536
5539
markexpr (sEXPR ,NULL ,0 );
5537
5540
pc_sideeffect = FALSE;
5541
+ pc_ovlassignment = FALSE;
5538
5542
ident = expression (val ,tag ,symptr ,chkfuncresult );
5539
5543
if (!allowarray && (ident == iARRAY || ident == iREFARRAY ))
5540
5544
error (33 ,"-unknown-" ); /* array must be indexed */
0 commit comments