https://issues.dlang.org/show_bug.cgi?id=19569
Mike Franklin <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #4 from Mike Franklin <[email protected]> --- I think what Jacob is saying is that `nothrow` will be inferred for templates at the time of instantiation based on the context of the instatiation. That means you should not create both `void foo(T)()` and `void foo(T)() nothrow`. When the template is instantiated the compiler will automatically add `nothrow` to the instantiation if the context is `nothrow`. The bug here may be that the compiler allowed you to declare both a `nothrow` and non-`nothrow` template without error. I suppose it should be an error to add any inferred attribute to templates if they're going to inferred by the caller. Either that, or, if the user explicitly added an attribute to a template, then inference for that attribute should be disabled at the time of instantiation. I can't say I approve of this attribute inference behavior -- I'd prefer to have some mataprogramming facilities to control it -- but that's the way D currently seems to work, so changing it would probably require a DIP. --
