aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/decl.cc
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-06-15 16:56:02 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-06-16 23:33:26 +0200
commit6c4db916e28bf97a729ec06ff71da03963f0f7e4 (patch)
treeeabf2e31908e50431f3c24f88c45ee96010b6a5e /gcc/d/decl.cc
parent89fdaf5ad853c3d55060b9929027946833aee77a (diff)
downloadgcc-6c4db916e28bf97a729ec06ff71da03963f0f7e4.zip
gcc-6c4db916e28bf97a729ec06ff71da03963f0f7e4.tar.gz
gcc-6c4db916e28bf97a729ec06ff71da03963f0f7e4.tar.bz2
d: Use toTypeFunction instead of explicit cast
gcc/d/ChangeLog: * d-frontend.cc (eval_builtin): Use toTypeFunction instead of cast. * decl.cc (DeclVisitor::visit): Likewise. * toir.cc (IRVisitor::visit): Likewise. * typeinfo.cc (TypeInfoVisitor::visit): Likewise.
Diffstat (limited to 'gcc/d/decl.cc')
-rw-r--r--gcc/d/decl.cc28
1 files changed, 8 insertions, 20 deletions
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index 0586863..a6144f7 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -449,26 +449,14 @@ public:
if (fd->leastAsSpecialized (fd2) || fd2->leastAsSpecialized (fd))
{
- TypeFunction *tf = (TypeFunction *) fd->type;
- if (tf->ty == Tfunction)
- {
- error_at (make_location_t (fd->loc), "use of %qs",
- fd->toPrettyChars ());
- inform (make_location_t (fd2->loc), "is hidden by %qs",
- fd2->toPrettyChars ());
- inform (make_location_t (d->loc),
- "use %<alias %s = %s.%s;%> to introduce base class "
- "overload set", fd->toChars (),
- fd->parent->toChars (), fd->toChars ());
- }
- else
- {
- error_at (make_location_t (fd->loc), "use of %qs",
- fd->toPrettyChars ());
- inform (make_location_t (fd2->loc), "is hidden by %qs",
- fd2->toPrettyChars ());
- }
-
+ error_at (make_location_t (fd->loc), "use of %qs",
+ fd->toPrettyChars ());
+ inform (make_location_t (fd2->loc), "is hidden by %qs",
+ fd2->toPrettyChars ());
+ inform (make_location_t (d->loc),
+ "use %<alias %s = %s.%s;%> to introduce base class "
+ "overload set", fd->toChars (),
+ fd->parent->toChars (), fd->toChars ());
has_errors = true;
break;
}