comparison dmd2/access.c @ 1452:638d16625da2

LDC 2 compiles again.
author Robert Clipsham <robert@octarineparrot.com>
date Sat, 30 May 2009 17:23:32 +0100
parents f04dde6e882c
children
comparison
equal deleted inserted replaced
1423:42bd767ec5a4 1452:638d16625da2
11 #include <stdio.h> 11 #include <stdio.h>
12 #include <stdlib.h> 12 #include <stdlib.h>
13 #include <assert.h> 13 #include <assert.h>
14 14
15 #include "root.h" 15 #include "root.h"
16 #include "mem.h" 16 #include "rmem.h"
17 17
18 #include "enum.h" 18 #include "enum.h"
19 #include "aggregate.h" 19 #include "aggregate.h"
20 #include "init.h" 20 #include "init.h"
21 #include "attrib.h" 21 #include "attrib.h"
255 error(loc, "member %s is not accessible", smember->toChars()); 255 error(loc, "member %s is not accessible", smember->toChars());
256 halt(); 256 halt();
257 } 257 }
258 } 258 }
259 259
260 /**************************************** 260 /****************************************
261 * Determine if this is the same or friend of cd. 261 * Determine if this is the same or friend of cd.
262 */ 262 */
263 263
264 int AggregateDeclaration::isFriendOf(AggregateDeclaration *cd) 264 int AggregateDeclaration::isFriendOf(AggregateDeclaration *cd)
265 { 265 {
390 //printf("accessCheck(%s)\n", d->toChars()); 390 //printf("accessCheck(%s)\n", d->toChars());
391 } 391 }
392 #endif 392 #endif
393 if (!e) 393 if (!e)
394 { 394 {
395 if (d->prot() == PROTprivate && d->getModule() != sc->module || 395 if (d->getModule() != sc->module)
396 d->prot() == PROTpackage && !hasPackageAccess(sc, d)) 396 if (d->prot() == PROTprivate ||
397 397 d->prot() == PROTpackage && !hasPackageAccess(sc, d))
398 error(loc, "%s %s.%s is not accessible from %s", 398
399 d->kind(), d->getModule()->toChars(), d->toChars(), sc->module->toChars()); 399 error(loc, "%s %s.%s is not accessible from %s",
400 d->kind(), d->getModule()->toChars(), d->toChars(), sc->module->toChars());
400 } 401 }
401 else if (e->type->ty == Tclass) 402 else if (e->type->ty == Tclass)
402 { // Do access check 403 { // Do access check
403 ClassDeclaration *cd; 404 ClassDeclaration *cd;
404 405