[cfe-dev] Link error in clang but not g++

John McCall rjmccall at apple.com
Thu Sep 15 11:34:48 PDT 2011


On Sep 15, 2011, at 11:26 AM, Holger Brandsmeier wrote:

> Marc,
> 
> this is precisely what is going on, without -C the symbols are:
> 
> 000014c0 W _ZN6parfem15QuadratureRulesIdLi0EEC2Ej
>         U _ZN6parfem15QuadratureRulesIdLi0EEC1Ej
> 
> and they are both demangled to the same:
> 
> c++filt _ZN6parfem15QuadratureRulesIdLi0EEC2Ej
> parfem::QuadratureRules<double, 0>::QuadratureRules(unsigned int)
> 
> c++filt _ZN6parfem15QuadratureRulesIdLi0EEC1Ej
> parfem::QuadratureRules<double, 0>::QuadratureRules(unsigned int)
> 
> Out of curiosity, what does the `C1Ej` and `C2Ej` part that decodes a
> different symbol, but does not appear in the demangling stand for?

Constructor variants.  C2 is used when constructing a base class
sub-object, C1 is used when constructing a complete object.  They're
semantically identical unless your class has virtual bases, but we have
to provide both according to the Itanium ABI.  Clang implements C1
in terms of C2 whenever it can.

John.



More information about the cfe-dev mailing list