comparison dmd/mtype.c @ 642:307ae566885f

Make default argument protection check not error for undefined protection. Fix symbol visibility issues in Tango.
author Christian Kamm <kamm incasoftware de>
date Fri, 03 Oct 2008 17:31:16 +0200
parents bc83491463f0
children 50383e476c7e
comparison
equal deleted inserted replaced
641:d9927f20758b 642:307ae566885f
2937 2937
2938 // make sure default arguments only use variables with lower protection 2938 // make sure default arguments only use variables with lower protection
2939 // this check only catches the common case that the default arg Exp is a VarExp 2939 // this check only catches the common case that the default arg Exp is a VarExp
2940 if(arg->defaultArg->op == TOKvar) 2940 if(arg->defaultArg->op == TOKvar)
2941 { VarExp *ve = (VarExp *)arg->defaultArg; 2941 { VarExp *ve = (VarExp *)arg->defaultArg;
2942 if(ve->var->protection < sc->protection) 2942 if(ve->var->protection != PROTundefined && ve->var->protection < sc->protection)
2943 error(loc, "default argument %s has stronger protection than function %s", ve->var->toChars(), toChars()); 2943 error(loc, "default argument %s has stronger protection than function %s", ve->var->toChars(), toChars());
2944 } 2944 }
2945 } 2945 }
2946 2946
2947 /* If arg turns out to be a tuple, the number of parameters may 2947 /* If arg turns out to be a tuple, the number of parameters may