Skip to content

Commit

Permalink
Fix broken test -- CTFE on an uninitialized variable
Browse files Browse the repository at this point in the history
This shouldn't compile. In most cases, a const variable with no initializer
could be set by 'this' (if it is a struct member) or by static this (if it
is a global). We could allow this particular case (a local variable in a
static function) to compile, but there doesn't seem to be much point in
introducing that corner case.
  • Loading branch information
Don Clugston committed Apr 14, 2011
1 parent ea65289 commit 11df108
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/runnable/xtest46.d
Expand Up @@ -1731,7 +1731,7 @@ struct Foo93

void test93()
{
const Foo93 bar;
const Foo93 bar = Foo93();
enum bla = bar.foo();
assert(bla == 2);
}
Expand Down

0 comments on commit 11df108

Please sign in to comment.