[Issue 9960] Show warnings/deprecations during template instantiation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 23 01:39:57 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9960



--- Comment #4 from Lionello Lunesu <lio+bugzilla at lunesu.com> 2013-04-23 01:39:56 PDT ---
(In reply to comment #3)
> > In fact, a different template might get picked with "-de" compared to the
> default "-dw" so we shouldn't ever gag deprecation errors during template
> instantiation, no matter whether "-v" was specified or not.
> 
> This is incorrect, it would remove the possibility of compiling without
> deprecated features, which is the most important and common case!

You can still do that, but you'd see the deprecation errors, which are not
fatal, but will cause that particular template instantiation to be skipped.

> This would break existing code, and worse, would give no way to fix it.

The only change is that with "-de" it would _print_ the deprecation errors.
Deprecation errors are already errors and cause template substitutions to fail.

> It's actually a difficult problem. What's needed instead, I think, is a flag
> for "tell me which recently deprecated features I'm still using."

I get your point, but I honestly think there's something dangerous about
getting different code with -dw compared to -de. I'd expect compilation to fail
if there are deprecating being used, no matter whether those features are used
within templates or not. (Heck, in D practically everything is a template
nowadays, so this point is even more important.) Therefor I think it's
perfectly valid to _PRINT_ deprecation errors as they happen, since you've
flagged them as errors and that's what they are.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list