aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/dmd/expression.c
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2021-01-11 10:53:18 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2021-01-11 12:21:03 +0100
commit928e96bbe98bafff18f11a7351cf89592967b061 (patch)
treed6a7b3082fec5da6bb9465ab4050a3470d18ab60 /gcc/d/dmd/expression.c
parent300a3ce5c5695eb1a7c0476e9d1b45420a463248 (diff)
downloadgcc-928e96bbe98bafff18f11a7351cf89592967b061.zip
gcc-928e96bbe98bafff18f11a7351cf89592967b061.tar.gz
gcc-928e96bbe98bafff18f11a7351cf89592967b061.tar.bz2
d: Remove visibility and lookup deprecation
The deprecation phase for access checks is finished. The `-ftransition=import` and `-ftransition=checkimports` switches no longer have an effect and are now removed. Symbols that are not visible in a particular scope will no longer be found by the compiler. Reviewed-on: https://github.com/dlang/dmd/pull/12124 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 2d3d13748. * d-lang.cc (d_handle_option): Remove OPT_ftransition_checkimports and OPT_ftransition_import. * gdc.texi (Warnings): Remove documentation for -ftransition=import and -ftransition=checkimports. * lang.opt (ftransition=checkimports): Remove. (ftransition=import): Remove.
Diffstat (limited to 'gcc/d/dmd/expression.c')
-rw-r--r--gcc/d/dmd/expression.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/gcc/d/dmd/expression.c b/gcc/d/dmd/expression.c
index 395dc56..3314d0c 100644
--- a/gcc/d/dmd/expression.c
+++ b/gcc/d/dmd/expression.c
@@ -677,7 +677,7 @@ static Dsymbol *searchScopes(Scope *sc, Loc loc, Identifier *ident, int flags)
* Find symbol in accordance with the UFCS name look up rule
*/
-Expression *searchUFCS(Scope *sc, UnaExp *ue, Identifier *ident)
+static Expression *searchUFCS(Scope *sc, UnaExp *ue, Identifier *ident)
{
//printf("searchUFCS(ident = %s)\n", ident->toChars());
Loc loc = ue->loc;
@@ -687,46 +687,13 @@ Expression *searchUFCS(Scope *sc, UnaExp *ue, Identifier *ident)
if (sc->flags & SCOPEignoresymbolvisibility)
flags |= IgnoreSymbolVisibility;
- Dsymbol *sold = NULL;
- if (global.params.bug10378 || global.params.check10378)
- {
- sold = searchScopes(sc, loc, ident, flags | IgnoreSymbolVisibility);
- if (!global.params.check10378)
- {
- s = sold;
- goto Lsearchdone;
- }
- }
-
// First look in local scopes
s = searchScopes(sc, loc, ident, flags | SearchLocalsOnly);
if (!s)
{
// Second look in imported modules
s = searchScopes(sc, loc, ident, flags | SearchImportsOnly);
-
- /** Still find private symbols, so that symbols that weren't access
- * checked by the compiler remain usable. Once the deprecation is over,
- * this should be moved to search_correct instead.
- */
- if (!s && !(flags & IgnoreSymbolVisibility))
- {
- s = searchScopes(sc, loc, ident, flags | SearchLocalsOnly | IgnoreSymbolVisibility);
- if (!s)
- s = searchScopes(sc, loc, ident, flags | SearchImportsOnly | IgnoreSymbolVisibility);
- if (s)
- ::deprecation(loc, "%s is not visible from module %s", s->toPrettyChars(), sc->_module->toChars());
- }
- }
- if (global.params.check10378)
- {
- Dsymbol *snew = s;
- if (sold != snew)
- Scope::deprecation10378(loc, sold, snew);
- if (global.params.bug10378)
- s = sold;
}
-Lsearchdone:
if (!s)
return ue->e1->type->Type::getProperty(loc, ident, 0);