[cfe-dev] -fno-implicit-templates in clang?

Douglas Gregor dgregor at apple.com
Mon May 14 20:48:39 PDT 2012


On May 14, 2012, at 8:29 PM, Jonny Yu wrote:

> Hello,
> 
> does clang 3.1 support -fno-implicit-templates option?

No, it does not.

> If not, is there any workarounds? 

To suppress specific instantiations, you can use extern templates. There's a trivial example of extern templates here:

	http://en.wikipedia.org/wiki/C%2B%2B11#Extern_template

and a little bit more in-depth discussion here:

	http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=344

However, I don't know of any general workarounds for the lack of -fno-implicit-templates.

	- Doug




More information about the cfe-dev mailing list