[cfe-dev] [PATCH] Using private types should be allowed as template parametter for explicit instantiation

Olivier Goffart ogoffart at kde.org
Tue Jun 22 11:39:44 PDT 2010


On Thursday 17 June 2010, Olivier Goffart wrote :
> Hello.
> 
> Attached you will find my attempt to fix
> http://llvm.org/bugs/show_bug.cgi?id=7267
> 
> The problem is that in this code
> 
> class X { class Y; };
> template<class T> struct Test {};
> template<> struct Test<X::Y> {};
> 
> Clang would complains that X::Y is private.
> 
> While the C++ specification 14.7.2 [temp.explicit] p11
> says it should compile (The usual access checking rules do not apply to
> names used to specify explicit instantiations)
> 
> (This break compilation of Qt's linguist tool)
> 
> 
> The patch is only one line but was not trivial.
> By having a ParsingDeclRAIIObject while parsing that kind of close, we make
> sure any diagnostic are delayed. And because I do not call complete() on
> it, the delayed diagnostic will not be issued.
> 
> Does my patch makes sens this time?
> 
> Regards.

Ping?

(btw, this is the right list for patches, right?)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug7267.diff
Type: text/x-patch
Size: 1500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100622/42ee3882/attachment.bin>


More information about the cfe-dev mailing list