Skip to content

Commit

Permalink
fix Issue 8724 - Throwing exception in constructor prints strange war…
Browse files Browse the repository at this point in the history
…ning
  • Loading branch information
9rnsr committed Sep 14, 2014
1 parent b835ce4 commit 0c813dc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/fail_compilation/fail8724.d
@@ -0,0 +1,16 @@
// REQUIRED_ARGS: -w
/*
TEST_OUTPUT:
---
fail_compilation/fail8724.d(14): Error: object.Exception is thrown but not caught
fail_compilation/fail8724.d(12): Error: constructor 'fail8724.Foo.this' is nothrow yet may throw
---
*/

struct Foo
{
this(int) nothrow
{
throw new Exception("something");
}
}

0 comments on commit 0c813dc

Please sign in to comment.