Fix Issue 7322 -- Taking address of deprecated functions isn't refused#1064
Fix Issue 7322 -- Taking address of deprecated functions isn't refused#1064edmccard wants to merge 1 commit intodlang:masterfrom edmccard:issue7322
Conversation
|
Please add the test cases that incorrectly fail from the bugzilla report. |
|
@edmccard : Can you merge small fail_compilation tests into one module with |
|
@9rnsr: In case of deprecation warnings, this might work, but in general, I'd prefer them to stay as separate tests. You simply can't test if the compiler exits with a failure for multiple tests in one compilation run, and grepping for all of them in the output might cause problems if we ever change how many error messages are displayed. Hm, maybe using multiple |
|
Yes, in general case that way will not work, but a deprecation error does not change the semantics of its later code, so compiler should warn all deprecation uses in one compilation. Then, squashing tests to one module with |
|
I'll have to do some more work. I thought it was working in the case "auto x = &y" but it isn't; I should have time to fix it in the next day or two. Then I'll be able to add the test case from the bug report. I will also consolidate the tests and use TEST_OUTPUT. |
|
Sorry for the delay. The issue was not with auto declarations, but with template functions. At the beginning of As far as I can tell, this is only reached when template functions are involved? Removing it allows the test case from the bug report, with Was there a reason to skip the rest of (Also, the fail_compliation tests have been consolidated to use TEST_OUTPUT) |
|
Please remove the import of std.string from the test case. Ideally no tests should use Phobos. Removing all the existing ones would be a pain but we should certainly not introduce any new tests involving it. Your output test includes a deprecation warning, that is definitely going to be removed and will change. If you need to, create a module with a function in it with the same signature as what you're using in the test. |
|
Rebased, and changed the template function test to use a top-level function in the test source, instead of from std.string. |
test/fail_compilation/fail7322.d
Outdated
There was a problem hiding this comment.
The import is still here, maybe you forgot to commit before a push -f?
|
@AndrejMitrovic, looks like that's what I did. Fixed now. |
There was a problem hiding this comment.
Sorry for dragging this on so long, but could you please add a test corresponding to Kenji's comment 4. Eg, right here add:
void function(int) shouldbeok = &f1;
which shouldn't generate any new errors.
|
ping? |
|
reping - will close in one week |
|
I added bug 7322 fix in #2130 - |
|
@9rnsr does that mean this should be close? |
|
@WalterBright Yes. |
http://d.puremagic.com/issues/show_bug.cgi?id=7322