[cfe-commits] r142693 - in /cfe/trunk: lib/CodeGen/CGRTTI.cpp lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaDeclCXX.cpp test/CodeGenCXX/weak-extern-typeinfo.cpp

Douglas Gregor dgregor at apple.com
Mon Dec 2 08:54:27 PST 2013


> On Dec 2, 2013, at 9:20 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
> 
>> On Fri, Oct 21, 2011 at 6:27 PM, Fariborz Jahanian <fjahanian at apple.com> wrote:
>> Author: fjahanian
>> Date: Fri Oct 21 17:27:12 2011
>> New Revision: 142693
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=142693&view=rev
>> Log:
>> c++: support gcc's application of weak attribute on
>> class declaration which forces any such class and any
>> class that inherits from such a class to have their
>> typeinfo symbols be marked as weak.
>> // rdar://10246395
> 
> Sorry to resurrect an ancient commit, but I happened to be in the code
> working on attribute subjects.
> 
> As best I can tell, gcc does not support this construct. I used the
> codegen test from this commit and got:
> 
> http://ideone.com/2TxMtR
> http://goo.gl/EU1HT9  (gcc.godbolt.com)
> 
> It seems that it emits a warning in gcc: 'weak' attribute does not
> apply to types.
> 
> So the question becomes: should I continue to support weak on a class
> declaration with my refactoring, should this feature be removed from
> clang, or should there be a separate refactoring to note that this is
> a clang-specific extension?

It was an extension in Apple's GCC and yes, please continue to support this in your refactoring: it's still an important feature. We added the feature to Clang specifically because users of Apple GCC requested it. 

  - Doug



More information about the cfe-commits mailing list