aboutsummaryrefslogtreecommitdiff
path: root/gcc/d
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
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')
-rw-r--r--gcc/d/d-lang.cc8
-rw-r--r--gcc/d/dmd/MERGE2
-rw-r--r--gcc/d/dmd/access.c21
-rw-r--r--gcc/d/dmd/dscope.c75
-rw-r--r--gcc/d/dmd/dsymbol.c23
-rw-r--r--gcc/d/dmd/expression.c35
-rw-r--r--gcc/d/dmd/expression.h2
-rw-r--r--gcc/d/dmd/expressionsem.c47
-rw-r--r--gcc/d/dmd/globals.h2
-rw-r--r--gcc/d/dmd/mtype.c69
-rw-r--r--gcc/d/dmd/parse.c1
-rw-r--r--gcc/d/dmd/scope.h1
-rw-r--r--gcc/d/dmd/traits.c2
-rw-r--r--gcc/d/gdc.texi10
-rw-r--r--gcc/d/lang.opt8
15 files changed, 61 insertions, 245 deletions
diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc
index 7b34209..72dcb71 100644
--- a/gcc/d/d-lang.cc
+++ b/gcc/d/d-lang.cc
@@ -551,10 +551,6 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
global.params.vcomplex = value;
break;
- case OPT_ftransition_checkimports:
- global.params.check10378 = value;
- break;
-
case OPT_ftransition_complex:
global.params.vcomplex = value;
break;
@@ -572,10 +568,6 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
global.params.vfield = value;
break;
- case OPT_ftransition_import:
- global.params.bug10378 = value;
- break;
-
case OPT_ftransition_nogc:
global.params.vgc = value;
break;
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index 435bf31..4f7f7a8 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -1,4 +1,4 @@
-cb1106ad5bea4293cd302b0ba1f3ce08905d40fe
+2d3d137489f030395d06cb664087fd1a35bccabe
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
diff --git a/gcc/d/dmd/access.c b/gcc/d/dmd/access.c
index 1a7238a..63f46c6 100644
--- a/gcc/d/dmd/access.c
+++ b/gcc/d/dmd/access.c
@@ -342,16 +342,9 @@ bool checkAccess(Loc loc, Scope *sc, Expression *e, Declaration *d)
return false;
}
if (!e)
- {
- if ((d->prot().kind == Prot::private_ && d->getAccessModule() != sc->_module) ||
- (d->prot().kind == Prot::package_ && !hasPackageAccess(sc, d)))
- {
- error(loc, "%s %s is not accessible from module %s",
- d->kind(), d->toPrettyChars(), sc->_module->toChars());
- return true;
- }
- }
- else if (e->type->ty == Tclass)
+ return false;
+
+ if (e->type->ty == Tclass)
{
// Do access check
ClassDeclaration *cd = (ClassDeclaration *)(((TypeClass *)e->type)->sym);
@@ -386,7 +379,7 @@ bool checkAccess(Loc loc, Scope *sc, Expression *e, Declaration *d)
* (see Bugzilla 313).
*
*/
-bool checkAccess(Loc loc, Scope *sc, Package *p)
+bool checkAccess(Scope *sc, Package *p)
{
if (sc->_module == p)
return false;
@@ -395,11 +388,7 @@ bool checkAccess(Loc loc, Scope *sc, Package *p)
if (sc->scopesym && sc->scopesym->isPackageAccessible(p, Prot(Prot::private_)))
return false;
}
- const char *name = p->toPrettyChars();
- if (p->isPkgMod == PKGmodule || p->isModule())
- deprecation(loc, "%s %s is not accessible here, perhaps add 'static import %s;'", p->kind(), name, name);
- else
- deprecation(loc, "%s %s is not accessible here", p->kind(), name);
+
return true;
}
diff --git a/gcc/d/dmd/dscope.c b/gcc/d/dmd/dscope.c
index 32caf7d..72dc089 100644
--- a/gcc/d/dmd/dscope.c
+++ b/gcc/d/dmd/dscope.c
@@ -453,47 +453,12 @@ Dsymbol *Scope::search(Loc loc, Identifier *ident, Dsymbol **pscopesym, int flag
if (this->flags & SCOPEignoresymbolvisibility)
flags |= IgnoreSymbolVisibility;
- Dsymbol *sold = NULL;
- if (global.params.bug10378 || global.params.check10378)
- {
- sold = searchScopes(this, loc, ident, pscopesym, flags | IgnoreSymbolVisibility);
- if (!global.params.check10378)
- return sold;
-
- if (ident == Id::dollar) // Bugzilla 15825
- return sold;
-
- // Search both ways
- }
-
// First look in local scopes
Dsymbol *s = searchScopes(this, loc, ident, pscopesym, flags | SearchLocalsOnly);
if (!s)
{
// Second look in imported modules
s = searchScopes(this, loc, ident, pscopesym, 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(this, loc, ident, pscopesym, flags | SearchLocalsOnly | IgnoreSymbolVisibility);
- if (!s)
- s = searchScopes(this, loc, ident, pscopesym, flags | SearchImportsOnly | IgnoreSymbolVisibility);
-
- if (s && !(flags & IgnoreErrors))
- ::deprecation(loc, "%s is not visible from module %s", s->toPrettyChars(), _module->toChars());
- }
- }
-
- if (global.params.check10378)
- {
- Dsymbol *snew = s;
- if (sold != snew)
- deprecation10378(loc, sold, snew);
- if (global.params.bug10378)
- s = sold;
}
return s;
}
@@ -607,7 +572,7 @@ structalign_t Scope::alignment()
* one with a close spelling.
*/
-void *scope_search_fp(void *arg, const char *seed, int* cost)
+static void *scope_search_fp(void *arg, const char *seed, int* cost)
{
//printf("scope_search_fp('%s')\n", seed);
@@ -640,45 +605,15 @@ void *scope_search_fp(void *arg, const char *seed, int* cost)
return (void*)s;
}
-void Scope::deprecation10378(Loc loc, Dsymbol *sold, Dsymbol *snew)
-{
- // Bugzilla 15857
- //
- // The overloadset found via the new lookup rules is either
- // equal or a subset of the overloadset found via the old
- // lookup rules, so it suffices to compare the dimension to
- // check for equality.
- OverloadSet *osold = NULL;
- OverloadSet *osnew = NULL;
- if (sold && (osold = sold->isOverloadSet()) != NULL &&
- snew && (osnew = snew->isOverloadSet()) != NULL &&
- osold->a.length == osnew->a.length)
- return;
-
- OutBuffer buf;
- buf.writestring("local import search method found ");
- if (osold)
- buf.printf("%s %s (%d overloads)", sold->kind(), sold->toPrettyChars(), (int)osold->a.length);
- else if (sold)
- buf.printf("%s %s", sold->kind(), sold->toPrettyChars());
- else
- buf.writestring("nothing");
- buf.writestring(" instead of ");
- if (osnew)
- buf.printf("%s %s (%d overloads)", snew->kind(), snew->toPrettyChars(), (int)osnew->a.length);
- else if (snew)
- buf.printf("%s %s", snew->kind(), snew->toPrettyChars());
- else
- buf.writestring("nothing");
-
- deprecation(loc, "%s", buf.peekChars());
-}
-
Dsymbol *Scope::search_correct(Identifier *ident)
{
if (global.gag)
return NULL; // don't do it for speculative compiles; too time consuming
+ Dsymbol *scopesym = NULL;
+ // search for exact name first
+ if (Dsymbol *s = search(Loc(), ident, &scopesym, IgnoreErrors))
+ return s;
return (Dsymbol *)speller(ident->toChars(), &scope_search_fp, this, idchars);
}
diff --git a/gcc/d/dmd/dsymbol.c b/gcc/d/dmd/dsymbol.c
index 5b4fad4..293484c 100644
--- a/gcc/d/dmd/dsymbol.c
+++ b/gcc/d/dmd/dsymbol.c
@@ -531,7 +531,9 @@ Dsymbol *Dsymbol::search_correct(Identifier *ident)
{
if (global.gag)
return NULL; // don't do it for speculative compiles; too time consuming
-
+ // search for exact name first
+ if (Dsymbol *s = search(Loc(), ident, IgnoreErrors))
+ return s;
return (Dsymbol *)speller(ident->toChars(), &symbol_search_fp, (void *)this, idchars);
}
@@ -1094,7 +1096,7 @@ Dsymbol *ScopeDsymbol::search(const Loc &loc, Identifier *ident, int flags)
if ((flags & IgnorePrivateImports) && prots[i] == Prot::private_)
continue;
- int sflags = flags & (IgnoreErrors | IgnoreAmbiguous | IgnoreSymbolVisibility); // remember these in recursive searches
+ int sflags = flags & (IgnoreErrors | IgnoreAmbiguous); // remember these in recursive searches
Dsymbol *ss = (*importedScopes)[i];
//printf("\tscanning import '%s', prots = %d, isModule = %p, isImport = %p\n", ss->toChars(), prots[i], ss->isModule(), ss->isImport());
@@ -1108,9 +1110,7 @@ Dsymbol *ScopeDsymbol::search(const Loc &loc, Identifier *ident, int flags)
{
if (flags & SearchImportsOnly)
continue;
- // compatibility with -transition=import (Bugzilla 15925)
- // SearchLocalsOnly should always get set for new lookup rules
- sflags |= (flags & SearchLocalsOnly);
+ sflags |= SearchLocalsOnly;
}
/* Don't find private members if ss is a module
@@ -1190,19 +1190,6 @@ Dsymbol *ScopeDsymbol::search(const Loc &loc, Identifier *ident, int flags)
a = mergeOverloadSet(ident, a, s);
s = a;
}
-
- // TODO: remove once private symbol visibility has been deprecated
- if (!(flags & IgnoreErrors) && s->prot().kind == Prot::private_ &&
- !s->isOverloadable() && !s->parent->isTemplateMixin() && !s->parent->isNspace())
- {
- AliasDeclaration *ad;
- // accessing private selective and renamed imports is
- // deprecated by restricting the symbol visibility
- if (s->isImport() || ((ad = s->isAliasDeclaration()) != NULL && ad->_import != NULL))
- {}
- else
- error(loc, "%s %s is private", s->kind(), s->toPrettyChars());
- }
//printf("\tfound in imports %s.%s\n", toChars(), s.toChars());
return s;
}
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);
diff --git a/gcc/d/dmd/expression.h b/gcc/d/dmd/expression.h
index d84878f..15a4d87 100644
--- a/gcc/d/dmd/expression.h
+++ b/gcc/d/dmd/expression.h
@@ -58,7 +58,7 @@ struct Symbol; // back end symbol
Expression *resolveProperties(Scope *sc, Expression *e);
Expression *resolvePropertiesOnly(Scope *sc, Expression *e1);
bool checkAccess(Loc loc, Scope *sc, Expression *e, Declaration *d);
-bool checkAccess(Loc loc, Scope *sc, Package *p);
+bool checkAccess(Scope *sc, Package *p);
Expression *build_overload(Loc loc, Scope *sc, Expression *ethis, Expression *earg, Dsymbol *d);
Dsymbol *search_function(ScopeDsymbol *ad, Identifier *funcid);
void expandTuples(Expressions *exps);
diff --git a/gcc/d/dmd/expressionsem.c b/gcc/d/dmd/expressionsem.c
index ecafd9d..a4ff0b4 100644
--- a/gcc/d/dmd/expressionsem.c
+++ b/gcc/d/dmd/expressionsem.c
@@ -43,6 +43,7 @@ bool checkAccess(AggregateDeclaration *ad, Loc loc, Scope *sc, Dsymbol *smember)
bool checkNestedRef(Dsymbol *s, Dsymbol *p);
bool checkFrameAccess(Loc loc, Scope *sc, AggregateDeclaration *ad, size_t istart = 0);
bool symbolIsVisible(Module *mod, Dsymbol *s);
+bool symbolIsVisible(Scope *sc, Dsymbol *s);
VarDeclaration *copyToTemp(StorageClass stc, const char *name, Expression *e);
Expression *extractSideEffect(Scope *sc, const char *name, Expression **e0, Expression *e, bool alwaysCopy = false);
Type *getTypeInfoType(Loc loc, Type *t, Scope *sc);
@@ -331,7 +332,7 @@ public:
/* See if the symbol was a member of an enclosing 'with'
*/
WithScopeSymbol *withsym = scopesym->isWithScopeSymbol();
- if (withsym && withsym->withstate->wthis)
+ if (withsym && withsym->withstate->wthis && symbolIsVisible(sc, s))
{
/* Disallow shadowing
*/
@@ -368,9 +369,20 @@ public:
{
if (withsym)
{
- Declaration *d = s->isDeclaration();
- if (d)
- checkAccess(exp->loc, sc, NULL, d);
+ if (withsym->withstate->exp->type->ty != Tvoid)
+ {
+ // with (exp)' is a type expression
+ // or 's' is not visible there (for error message)
+ e = new TypeExp(exp->loc, withsym->withstate->exp->type);
+ }
+ else
+ {
+ // 'with (exp)' is a Package/Module
+ e = withsym->withstate->exp;
+ }
+ e = new DotIdExp(exp->loc, e, exp->ident);
+ result = semantic(e, sc);
+ return;
}
/* If f is really a function template,
@@ -8374,17 +8386,18 @@ Expression *semanticY(DotIdExp *exp, Scope *sc, int flag)
*/
if (s && !(sc->flags & SCOPEignoresymbolvisibility) && !symbolIsVisible(sc->_module, s))
{
- if (s->isDeclaration())
- ::error(exp->loc, "%s is not visible from module %s", s->toPrettyChars(), sc->_module->toChars());
- else
- ::deprecation(exp->loc, "%s is not visible from module %s", s->toPrettyChars(), sc->_module->toChars());
- // s = NULL
+ s = NULL;
+ }
+ if (s)
+ {
+ Package *p = s->isPackage();
+ if (p && checkAccess(sc, p))
+ {
+ s = NULL;
+ }
}
if (s)
{
- if (Package *p = s->isPackage())
- checkAccess(exp->loc, sc, p);
-
// if 's' is a tuple variable, the tuple is returned.
s = s->toAlias();
@@ -8555,8 +8568,14 @@ Expression *semanticY(DotIdExp *exp, Scope *sc, int flag)
return NULL;
s = ie->sds->search_correct(exp->ident);
if (s)
- exp->error("undefined identifier '%s' in %s '%s', did you mean %s '%s'?",
- exp->ident->toChars(), ie->sds->kind(), ie->sds->toPrettyChars(), s->kind(), s->toChars());
+ {
+ if (s->isPackage())
+ exp->error("undefined identifier `%s` in %s `%s`, perhaps add `static import %s;`",
+ exp->ident->toChars(), ie->sds->kind(), ie->sds->toPrettyChars(), s->toPrettyChars());
+ else
+ exp->error("undefined identifier '%s' in %s '%s', did you mean %s '%s'?",
+ exp->ident->toChars(), ie->sds->kind(), ie->sds->toPrettyChars(), s->kind(), s->toChars());
+ }
else
exp->error("undefined identifier '%s' in %s '%s'",
exp->ident->toChars(), ie->sds->kind(), ie->sds->toPrettyChars());
diff --git a/gcc/d/dmd/globals.h b/gcc/d/dmd/globals.h
index 502bae2..6e65d86 100644
--- a/gcc/d/dmd/globals.h
+++ b/gcc/d/dmd/globals.h
@@ -126,8 +126,6 @@ struct Param
bool betterC; // be a "better C" compiler; no dependency on D runtime
bool addMain; // add a default main() function
bool allInst; // generate code for all template instantiations
- bool check10378; // check for issues transitioning to 10738
- bool bug10378; // use pre-bugzilla 10378 search strategy
bool vsafe; // use enhanced @safe checking
unsigned cplusplus; // version of C++ name mangling to support
bool showGaggedErrors; // print gagged errors anyway
diff --git a/gcc/d/dmd/mtype.c b/gcc/d/dmd/mtype.c
index ceee70a..cc8eb22 100644
--- a/gcc/d/dmd/mtype.c
+++ b/gcc/d/dmd/mtype.c
@@ -6996,8 +6996,8 @@ void TypeQualified::resolveHelper(Loc loc, Scope *sc,
Dsymbol *sm = s->searchX(loc, sc, id);
if (sm && !(sc->flags & SCOPEignoresymbolvisibility) && !symbolIsVisible(sc, sm))
{
- ::deprecation(loc, "%s is not visible from module %s", sm->toPrettyChars(), sc->_module->toChars());
- // sm = NULL;
+ ::error(loc, "`%s` is not visible from module `%s`", sm->toPrettyChars(), sc->_module->toChars());
+ sm = NULL;
}
if (global.errors != errorsave)
{
@@ -7965,29 +7965,6 @@ Dsymbol *TypeStruct::toDsymbol(Scope *)
return sym;
}
-static Dsymbol *searchSymStruct(Scope *sc, Dsymbol *sym, Expression *e, Identifier *ident)
-{
- int flags = sc->flags & SCOPEignoresymbolvisibility ? IgnoreSymbolVisibility : 0;
- Dsymbol *sold = NULL;
- if (global.params.bug10378 || global.params.check10378)
- {
- sold = sym->search(e->loc, ident, flags);
- if (!global.params.check10378)
- return sold;
- }
-
- Dsymbol *s = sym->search(e->loc, ident, flags | SearchLocalsOnly);
- if (global.params.check10378)
- {
- Dsymbol *snew = s;
- if (sold != snew)
- Scope::deprecation10378(e->loc, sold, snew);
- if (global.params.bug10378)
- s = sold;
- }
- return s;
-}
-
Expression *TypeStruct::dotExp(Scope *sc, Expression *e, Identifier *ident, int flag)
{
Dsymbol *s;
@@ -8038,7 +8015,8 @@ Expression *TypeStruct::dotExp(Scope *sc, Expression *e, Identifier *ident, int
return e;
}
- s = searchSymStruct(sc, sym, e, ident);
+ const int flags = sc->flags & SCOPEignoresymbolvisibility ? IgnoreSymbolVisibility : 0;
+ s = sym->search(e->loc, ident, flags | IgnorePrivateImports);
L1:
if (!s)
{
@@ -8046,8 +8024,7 @@ L1:
}
if (!(sc->flags & SCOPEignoresymbolvisibility) && !symbolIsVisible(sc, s))
{
- ::deprecation(e->loc, "%s is not visible from module %s", s->toPrettyChars(), sc->_module->toPrettyChars());
- // return noMember(sc, e, ident, flag);
+ return noMember(sc, e, ident, flag);
}
if (!s->isFuncDeclaration()) // because of overloading
{
@@ -8524,35 +8501,6 @@ Dsymbol *TypeClass::toDsymbol(Scope *)
return sym;
}
-static Dsymbol *searchSymClass(Scope *sc, Dsymbol *sym, Expression *e, Identifier *ident)
-{
- int flags = sc->flags & SCOPEignoresymbolvisibility ? IgnoreSymbolVisibility : 0;
- Dsymbol *sold = NULL;
- if (global.params.bug10378 || global.params.check10378)
- {
- sold = sym->search(e->loc, ident, flags | IgnoreSymbolVisibility);
- if (!global.params.check10378)
- return sold;
- }
-
- Dsymbol *s = sym->search(e->loc, ident, flags | SearchLocalsOnly);
- if (!s && !(flags & IgnoreSymbolVisibility))
- {
- s = sym->search(e->loc, ident, flags | SearchLocalsOnly | IgnoreSymbolVisibility);
- if (s && !(flags & IgnoreErrors))
- ::deprecation(e->loc, "%s is not visible from class %s", s->toPrettyChars(), sym->toChars());
- }
- if (global.params.check10378)
- {
- Dsymbol *snew = s;
- if (sold != snew)
- Scope::deprecation10378(e->loc, sold, snew);
- if (global.params.bug10378)
- s = sold;
- }
- return s;
-}
-
Expression *TypeClass::dotExp(Scope *sc, Expression *e, Identifier *ident, int flag)
{
Dsymbol *s;
@@ -8606,7 +8554,9 @@ Expression *TypeClass::dotExp(Scope *sc, Expression *e, Identifier *ident, int f
return e;
}
- s = searchSymClass(sc, sym, e, ident);
+ int flags = sc->flags & SCOPEignoresymbolvisibility ? IgnoreSymbolVisibility : 0;
+ s = sym->search(e->loc, ident, flags | IgnorePrivateImports);
+
L1:
if (!s)
{
@@ -8754,8 +8704,7 @@ L1:
}
if (!(sc->flags & SCOPEignoresymbolvisibility) && !symbolIsVisible(sc, s))
{
- ::deprecation(e->loc, "%s is not visible from module %s", s->toPrettyChars(), sc->_module->toPrettyChars());
- // return noMember(sc, e, ident, flag);
+ return noMember(sc, e, ident, flag);
}
if (!s->isFuncDeclaration()) // because of overloading
{
diff --git a/gcc/d/dmd/parse.c b/gcc/d/dmd/parse.c
index 2664af2..bae3448 100644
--- a/gcc/d/dmd/parse.c
+++ b/gcc/d/dmd/parse.c
@@ -644,7 +644,6 @@ Dsymbols *Parser::parseDeclDefs(int once, Dsymbol **pLastDecl, PrefixAttributes
case TOKdeprecated:
{
- Expression *e = NULL;
if (StorageClass _stc = parseDeprecatedAttribute(this, &pAttrs->depmsg))
{
stc = _stc;
diff --git a/gcc/d/dmd/scope.h b/gcc/d/dmd/scope.h
index b22823f..7e1b634 100644
--- a/gcc/d/dmd/scope.h
+++ b/gcc/d/dmd/scope.h
@@ -144,7 +144,6 @@ struct Scope
Module *instantiatingModule();
Dsymbol *search(Loc loc, Identifier *ident, Dsymbol **pscopesym, int flags = IgnoreNone);
- static void deprecation10378(Loc loc, Dsymbol *sold, Dsymbol *snew);
Dsymbol *search_correct(Identifier *ident);
static const char *search_correct_C(Identifier *ident);
Dsymbol *insert(Dsymbol *s);
diff --git a/gcc/d/dmd/traits.c b/gcc/d/dmd/traits.c
index 46b7d96..5fd4b48 100644
--- a/gcc/d/dmd/traits.c
+++ b/gcc/d/dmd/traits.c
@@ -933,7 +933,7 @@ Expression *semanticTraits(TraitsExp *e, Scope *sc)
return dimError(e, 1, dim);
Scope *sc2 = sc->push();
- sc2->flags = sc->flags | SCOPEnoaccesscheck;
+ sc2->flags = sc->flags | SCOPEnoaccesscheck | SCOPEignoresymbolvisibility;
bool ok = TemplateInstance::semanticTiargs(e->loc, sc2, e->args, 1);
sc2->pop();
if (!ok)
diff --git a/gcc/d/gdc.texi b/gcc/d/gdc.texi
index 7f4906d..e727848 100644
--- a/gcc/d/gdc.texi
+++ b/gcc/d/gdc.texi
@@ -634,8 +634,6 @@ Report additional information about D language changes identified by
@table @samp
@item all
List information on all language changes.
-@item checkimports
-Give deprecation messages about @option{-ftransition=import} anomalies.
@item complex
List all usages of complex or imaginary types.
@item dip1000
@@ -644,14 +642,6 @@ Implements @uref{http://wiki.dlang.org/DIP1000} (experimental).
Implements @uref{http://wiki.dlang.org/DIP25} (experimental).
@item field
List all non-mutable fields which occupy an object instance.
-@item import
-Tells the compiler to revert to using an old lookup behavior for resolving
-unqualified symbol names, where this was done in a single pass, ignoring
-any protection attributes. The default name lookup strategy is to use two
-passes, the first ignoring imported declarations, and the second only
-looking at imports. The protection (@code{private}, @code{package},
-@code{protected}) of symbols is also enforced to resolve any conflicts
-between private and public symbols.
@item nogc
List all hidden GC allocations.
@item tls
diff --git a/gcc/d/lang.opt b/gcc/d/lang.opt
index 6c8dfbf..62e9f8e 100644
--- a/gcc/d/lang.opt
+++ b/gcc/d/lang.opt
@@ -289,10 +289,6 @@ ftransition=all
D RejectNegative
List information on all language changes.
-ftransition=checkimports
-D RejectNegative
-Give deprecation messages about -ftransition=import anomalies.
-
ftransition=complex
D RejectNegative
List all usages of complex or imaginary types.
@@ -309,10 +305,6 @@ ftransition=field
D RejectNegative
List all non-mutable fields which occupy an object instance.
-ftransition=import
-D RejectNegative
-Revert to single phase name lookup.
-
ftransition=nogc
D RejectNegative
List all hidden GC allocations.