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

Aaron Ballman aaron at aaronballman.com
Mon Dec 2 06:20:24 PST 2013


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?

Thanks!

~Aaron



More information about the cfe-commits mailing list