[Issue 9934] template default argument should be semantically analysed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 16 03:18:06 PDT 2013


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


timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr at gmx.ch
           Severity|normal                      |enhancement


--- Comment #4 from timon.gehr at gmx.ch 2013-04-16 03:18:04 PDT ---
(In reply to comment #0)
> cat > bug.d << CODE
> template foo(T = NonExistent)
> {
> }
> CODE
> 
> dmd -c bug
> 
> ----
> 
> This currently compiles even though the default parameter can never be valid.
> When the default parameter is a template instance it is missing from the object
> file. I think we should run full semantics on the default arguments when
> compiling a module.

This is not really clear. Default parameters can depend on other template
arguments. Therefore, running full semantics is not possible.

You'd have to specify clearly in what cases there is an error. However, I think
it is not necessarily a good idea to add non-obvious rules about validity of a
template declaration.

-- 
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