[cfe-commits] [Patch] disallow function template partial specialization

Douglas Gregor dgregor at apple.com
Mon Jan 24 10:58:06 PST 2011


On Jan 24, 2011, at 3:50 AM, Hans Wennborg wrote:

> Hi,
> 
> The attached patch attempts to fix http://llvm.org/bugs/show_bug.cgi?id=8295
> 
> My reasoning is that:
> 
> 1. For a regular function template declaration, one would never have
> template arguments
> 2. The same holds for overloading
> 3. For a function template explicit specialization ("full
> specialization"), one would never have template parameters.
> 
> So, if a function template declaration has both template parameters
> and template arguments, it must be an attempt at partial
> specialization.
> 
> I would be grateful if someone with deeper C++ knowledge could verify
> that this is correct.

Yes, this is all correct.

> 
> Also, does C++0x change any of this?

No, C++0x did not change this at all.

Your patch looks great. I've committed it as r124135, thanks!

	- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110124/b23fa3ed/attachment.html>


More information about the cfe-commits mailing list