Skip to content

Commit

Permalink
Improve diagnostic message for the invalid auto attribute on function…
Browse files Browse the repository at this point in the history
… parameters
  • Loading branch information
9rnsr committed Aug 30, 2015
1 parent dc044fe commit 9779b69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mtype.d
Expand Up @@ -6014,7 +6014,7 @@ public:
}
else
{
error(loc, "auto can only be used for template function parameters");
error(loc, "'auto' can only be used as part of 'auto ref' for template function parameters");
errors = true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/fail_compilation/fail14669.d
@@ -1,9 +1,9 @@
/*
TEST_OUTPUT:
---
fail_compilation/fail14669.d(11): Error: auto can only be used for template function parameters
fail_compilation/fail14669.d(11): Error: 'auto' can only be used as part of 'auto ref' for template function parameters
fail_compilation/fail14669.d(16): Error: template instance fail14669.foo1!() error instantiating
fail_compilation/fail14669.d(12): Error: auto can only be used for template function parameters
fail_compilation/fail14669.d(12): Error: 'auto' can only be used as part of 'auto ref' for template function parameters
fail_compilation/fail14669.d(17): Error: template fail14669.foo2 cannot deduce function from argument types !()(int), candidates are:
fail_compilation/fail14669.d(12): fail14669.foo2()(auto int a)
---
Expand Down

0 comments on commit 9779b69

Please sign in to comment.