Skip to content

Commit

Permalink
Merge pull request #5432 from mathias-lang-sociomantic/fix-15665
Browse files Browse the repository at this point in the history
Fix issue #15665: Templated scope class with constructor doesn't compile
  • Loading branch information
WalterBright committed Feb 10, 2016
2 parents 6b608b0 + 4a38b1d commit c32ccb7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/func.d
Expand Up @@ -2220,6 +2220,8 @@ public:
if (!f.deco && ident != Id.xopEquals && ident != Id.xopCmp)
{
sc = sc.push();
if (isCtorDeclaration()) // Bugzilla #15665
sc.flags |= SCOPEctor;
sc.stc = 0;
sc.linkage = linkage; // Bugzilla 8496
type = f.semantic(loc, sc);
Expand Down
14 changes: 14 additions & 0 deletions test/runnable/sctor.d
Expand Up @@ -336,6 +336,19 @@ void test14944()
assert(tbl14944[0] == 1);
}

/***************************************************/
// 15665

scope class C15665 (V)
{
this () {}
}

void test15665()
{
scope foo = new C15665!int;
}

/***************************************************/

int main()
Expand All @@ -345,6 +358,7 @@ int main()
test11246();
test13515();
test14944();
test15665();

printf("Success\n");
return 0;
Expand Down

0 comments on commit c32ccb7

Please sign in to comment.