[cfe-dev] Template attributes lose their inherited flag on instantiations

Nico Rieck nico.rieck at gmail.com
Tue Apr 16 00:59:17 PDT 2013


Hi,

I noticed that when a template is instanciated and all attributes are 
pulled over (using sema::instantiateTemplateAttribute), inheritable 
attributes lose their inherited flag. Is this a bug/an oversight or 
intended behavior?

In my case the inherited status is used to distinguish between 
DLLImportAttr/DLLExportAttr applied directly to class members and 
inherited from the class. When those attributes are applied to a class 
template, and in turn applied to class members with the inherited flag 
set, this distinction is lost for the members of the template instantiation.

I changed the generated code to propagate the flag and it doesn't seem 
to break anything. So at least nothing tested seems to rely on that.

-Nico



More information about the cfe-dev mailing list