Skip to content

Commit

Permalink
Merge pull request #2547 from WalterBright/revert-pull-1325
Browse files Browse the repository at this point in the history
revert pull 1325
  • Loading branch information
9rnsr committed Sep 10, 2013
2 parents 6db24cd + b10b018 commit fe5dfc5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
9 changes: 0 additions & 9 deletions src/declaration.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,21 +879,13 @@ void VarDeclaration::semantic(Scope *sc)
e = new ErrorExp();
}
init = new ExpInitializer(e->loc, e);

sc = sc->push();
if (storage_class & STCmanifest) sc->flags |= SCOPEstaticif;
type = init->inferType(sc);
sc = sc->pop();

if (type->ty == Tsarray)
type = type->nextOf()->arrayOf();
}
else
{
sc = sc->push();
if (storage_class & STCmanifest) sc->flags |= SCOPEstaticif;
type = init->inferType(sc);
sc = sc->pop();
}

if (needctfe) sc = sc->endCTFE();
Expand Down Expand Up @@ -1412,7 +1404,6 @@ void VarDeclaration::semantic(Scope *sc)
{
sc = sc->push();
sc->stc &= ~(STC_TYPECTOR | STCpure | STCnothrow | STCref | STCdisable);
if (storage_class & STCmanifest) sc->flags |= SCOPEstaticif;

ArrayInitializer *ai = init->isArrayInitializer();
if (ai && tb->ty == Taarray)
Expand Down
43 changes: 0 additions & 43 deletions test/runnable/declaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -198,48 +198,6 @@ void test8942()
}
}

/***************************************************/
// 9073

bool foo9073(bool expected, alias pred)()
{
static if (expected)
{
enum isLessThan = (is(typeof(pred) : string) && pred == "a < b");
}
else
{
static if (is(typeof(pred) : string) && pred == "a < b")
enum isLessThan = true;
else
enum isLessThan = false;
}
return isLessThan;
}

template Failure9073() { static assert(0); enum Failure9073 = false; }
template AndAnd9073a(alias pred) { enum bool AndAnd9073a = (is(typeof(pred) : string) && pred == "a < b"); }
template AndAnd9073b(alias pred) { enum AndAnd9073b = (is(typeof(pred) : string) && pred == "a < b"); }
template OrOr9073a(alias pred) { enum bool OrOr9073a = (is(typeof(pred) : string) || Failure9073!()); }
template OrOr9073b(alias pred) { enum OrOr9073b = (is(typeof(pred) : string) || Failure9073!()); }

void test9073()
{
assert(foo9073!(true, "a < b")() == true);
assert(foo9073!(false, "a < b")() == true);
assert(foo9073!(true, (a,b) => a<b)() == false);
assert(foo9073!(false, (a,b) => a<b)() == false);

static assert( AndAnd9073a!("a < b"));
static assert( AndAnd9073b!("a < b"));
static assert(!AndAnd9073a!((a,b)=>true));
static assert(!AndAnd9073b!((a,b)=>true));
static assert( OrOr9073a!("a < b"));
static assert( OrOr9073b!("a < b"));
static assert(!__traits(compiles, OrOr9073a!((a,b)=>true)));
static assert(!__traits(compiles, OrOr9073b!((a,b)=>true)));
}

/***************************************************/
// 10144

Expand Down Expand Up @@ -313,7 +271,6 @@ int main()
test8147();
test8410();
test8942();
test9073();
test10142();

printf("Success\n");
Expand Down

0 comments on commit fe5dfc5

Please sign in to comment.